jscrollpane块滚动父级

编程入门 行业动态 更新时间:2024-10-09 23:23:40
本文介绍了jscrollpane块滚动父级的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我可以制作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块滚动父级

本文发布于:2023-11-23 04:20:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1620063.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:jscrollpane

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!