本文介绍了jQuery的尼斯滚动不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在为div使用Jquery nice滚动条,但是当div的内容动态增加时,它不会显示滚动条.如果我删除漂亮的滚动条,Windows默认滚动条将正常工作.谁能帮我解决这个问题?
I am using Jquery nice Scroll bar for div, but when content of div increases dynamically its not showing scroll bar. Windows default scroll bar works fine if i remove nice scroll.Can anyone help me to solve this problem?
HTML
<div id="div-to-scroll">
</div>
脚本
$(document).ready(function(e) {
var nice = $("#div-to-scroll").getNiceScroll();
$("#div-to-scroll").niceScroll();
$("#div-to-scroll").getNiceScroll().resize();
});
这是我的代码示例.
推荐答案
最后,这对我有用.
$("#div-to-scroll").scroll(function(){
$("#div-to-scroll").getNiceScroll().resize();
});
这篇关于jQuery的尼斯滚动不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!