jQuery jscrollpane插件错误 [英] Jquery jscrollpane plugin error
问题描述
当我尝试在Safari 4中实现jSrollpane时出现此错误:
I get this error when I try and implement jSrollpane in Safari 4:
TypeError:表达式'$ drag [0]'[未定义]的结果不是对象.
然后我在Chrome中尝试相同的操作时收到此错误:
Then i get this error when i try the same thing in Chrome:
未捕获的TypeError:无法读取未定义的属性'offsetHeight'
但是为什么呢?在FF中效果很好.
But why? it works fine in FF.
有什么想法吗?
推荐答案
jQuery似乎无法解析子选择器(父>子"),因此两者 "$ track"和"$ drag"设置为未定义的值:
It appears that jQuery does not manage to resolve the child selector ("parent > child"), thus both "$track" and "$drag" are set to undefined values:
$track = $('>.jScrollPaneTrack', $container);
$drag = $('>.jScrollPaneTrack .jScrollPaneDrag', $container);
结果,滚动条不初始化,仅不执行任何操作 将前面的几行替换为下沉的"版本可解决此问题:
As a result, the scrollbar does not initialize, and simply does nothing Replacing the previous lines with a "dumbed down" version fixes the issue:
$track = $container.children(".jScrollPaneTrack");
$drag = $track.children(".jScrollPaneDrag");
这篇关于jQuery jscrollpane插件错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!