2012-10-30 36 views
2

問題是在加載網站時,.mCSB_container類的寬度可以,但是當我點擊一個鏈接時,例如「項目」鏈接,它會觸發ajax函數,即使內容不是那麼多,.mCSB_container的寬度也不會改變。網頁在點擊鏈接時不會加載。我嘗試使用「更新」功能,但似乎它不工作。Malihu自定義滾動條Ajax內容.mCSB_container寬度不更新

+0

任何幫助是非常appreciated..thanks提前.. –

回答

1

確定我使用這個插件,我不得不TE同樣的問題,但檢查:

<script type="text/javascript"> 
$(function() { 
    $("#content").mCustomScrollbar({ 
     scrollButtons:{ 
      enable:true 
     }, 
     advanced:{ 
      updateOnContentResize: true // <- the solution 
     } 
    }); 

    // get ajax link 
    $('.Link').click(function(){ 
     $.get(this.href, function(data) { 
      $("#content .mCSB_container").html(data); // fill .mCSB_container 
      $("#content").mCustomScrollbar("update"); 
      $("#content").mCustomScrollbar(
       "scrollTo" 
       ,"top" 
       ,{scrollInertia:200} 
      ); // go to Top content 
     }); 
     return false; 
    }); 
}); 
</script>