2014-02-20 50 views
1
(function($){ 
    $(window).load(function(){ 
     $("#content_1").mCustomScrollbar({ 
      scrollButtons: { 
       enable: true 
      }, 
      theme: "dark", 
      horizontalScroll: true, 
      advanced: { updateOnContentResize: true, updateOnBrowserResize: true } 
     }); 
    }); 
})(jQuery); 

我使用上面的代碼在相同的內容中顯示水平和垂直滾動條,但是隻有水平滾動條出現。我如何強制顯示兩個滾動條?如何使用mCustomScrollbar顯示水平和垂直滾動條?

回答

0

好吧,這也成了我的問題。看來,mcustomscrollbar目前不支持此功能。你可以嵌套它,但你不能有垂直和水平滾動條在mcustomscrollbar的同一個實例。不妨使用另一個滾動條插件。你可以參考this thread

5
$("#content_1").mCustomScrollbar({ 
       axis:"yx", 
       setHeight: 'auto', 
       setWidth: "auto", 
       theme:"dark" 
      }); 

你可以找到一些這方面的網頁http://manos.malihu.gr/jquery-custom-content-scroller/

上,我相信調用setHeight:「自動」和setWidth「自動」是什麼主要是幫助這項工作。