2013-02-08 4 views
0

아약스 tabbing jquery를 사용하는 may 웹 페이지에서 jquery nicescroll (http://areaaperta.com/nicescroll/)을 사용하고 있습니다.jquery nicescroll을 빠르게로드하는 방법

로드 할 news.html을 호출하는 main.php 페이지가 있습니다.

main.php

<nav> 
<ul> 
... 
<li><a href="news.html">News</a></li> 
... 
</nav> 
<section id="cont1"> 
... 
</section> 
<section id="cont2" style="display:none"> 
</section> 

아약스 - 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; 
    }); 

news.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에서 기본 스크롤이 먼저 표시됩니다.

데모가 기본 스크롤을 표시하지 않았으므로 아약스 탭 jquery 때문일 것이라고 생각합니다.

jquery nicescroll이 빠르게로드되는 대신 기본 스크롤이 표시되지 않는 방법이 있습니까?

답변

0

jQuery 호출 후 기본 스크롤을로드하면 작동합니까?

관련 문제