我可以制作jscrollpne,即使子滚动到达底部时,父窗格也不会滚动。现在,当子滚动到达底部时,父卷轴会发生滚动。我希望父级只在鼠标离开子滚动窗格时滚动。
Can i make jscrollpne such that parent pane doesnot scroll even when child scroll has reached its bottom. Now when child scrolling reaches bottom scrolling of parent occurs. I want parent to scroll only when mouse is out of child scrollpane.
推荐答案您描述的行为是设计的。这是本机浏览器滚动条在具有overflow:auto的元素上的行为方式。我不建议改变它。但是,如果您希望Borgenk的答案是正确的,您可以使用以下代码:
The behaviour you describe is by design. This is how the native browser scrollbars behave on an element which has overflow: auto. I wouldn't recommend changing it. However, if you wish to then Borgenk's answer is correct, you can use this code:
$('.scroll-pane') .jScrollPane() .bind( 'mousewheel', function(e) { e.preventDefault(); } );在此处查看示例(您可能需要缩小窗口,以便父级需要滚动) : jsfiddle/VYcDZ/51/
See an example here (you may need to shrink your window so the parent has any need to scroll): jsfiddle/VYcDZ/51/
更多推荐
jscrollpane块滚动父级
发布评论