我无论如何也想不出这件事。我的头要爆炸了..。
我在我的网站上使用了这个滚动条插件,因为它可能是唯一可以正常响应的滚动条。但是,我正在尝试更改箭头处理。- https://github.com/gromo/jquery.scrollbar/blob/master/jquery.scrollbar.js
在第324行有一些代码,如下所示:
scrollx.scroll.find('.scroll-arrow, .scroll-element_track')
    .on('mousedown' + namespace, function (event) {我正在尝试将'scrollx.scroll.find‘更改为'this.find’或'this.container.find‘,它们是上面存储在文件中的变量。
谁能给我一个快速的峰值,告诉我如何传递这个变量。我尝试在它所在的'each‘函数中传递它,然后使用它,但它不起作用,控制台显示:'jquery.scrollbar.js:324 Uncaught : Cannot read property 'find’of undefined‘。
谢谢你的帮助。任何洞察力都是值得欣赏的。
PS。我在一个页面上有多个滚动,因此必须获取它的当前容器。
发布于 2016-06-29 19:50:36
只需使用:
$('.scroll-arrow, .scroll-element_track')
    .on('mousedown' + namespace, function(event) {
}或
$(parent id).find('.scroll-arrow, .scroll-element_track')
    .on('mousedown' + namespace, function (event) {
}https://stackoverflow.com/questions/38098619
复制相似问题