我在使用 ajax 选项卡jquery 的可能网页中使用 jquery nicescroll ( http://areaaperta.com/nicescroll/ )。
我有调用 news.html 加载的 main.php 页面。
主文件
<nav>
<ul>
...
<li><a href="news.html">News</a></li>
...
</nav>
<section id="cont1">
...
</section>
<section id="cont2" style="display:none">
</section>
ajax-load.js
$(document).ready(function() {
$("ul li a").click(function() {
;
$("section#cont2").fadeIn(200).siblings().hide();
$("ul li a").removeClass('current');
$(this).addClass('current');
$.ajax({ url: this.href, success: function(html) {
$("section#cont2").empty().append(html);
}
});
return false;
});
新闻.html css
#content-scroll{
height:500px;
overflow-y: scroll;
}
这是我的 news.html
<script type="text/javascript" src="assets/js/jquery.nicescroll.js"></script>
<script>
$(document).ready(function() {
$("#content-scroll").niceScroll({cursorcolor:"#000",background:"#ccc",autohidemode:false});
});
</script>
<div id="content-scroll">
.... long text ....
</div>
我现在的问题是,在现场,当我调用 news.html 时,默认滚动将首先显示,然后在 jquery nicescroll 上显示。
该演示没有显示默认滚动,我认为这是因为 ajax tabbing jquery。
有什么方法不会显示默认滚动,而是快速加载 jquery nicescroll?