2010-08-21 6 views
8

jScrollPane div의 컨테이너 인 창의 너비가 100 인 div가 있습니다.jScrollPane resize

스크롤 창 크기 조정이 움직이지 않는다면 창에 jScrollPane 크기를 조정할 수 있습니까?

감사합니다.

답변

12

API 호출 reinitialise()를 사용하여이 작업을 수행 할 수 있습니다. 예제 페이지 중 하나에서 다루어집니다.

$(function() 
{ 
$('.scroll-pane').each(
    function() 
    { 
     $(this).jScrollPane(
      { 
       showArrows: $(this).is('.arrow') 
      } 
     ); 
     var api = $(this).data('jsp'); 
     var throttleTimeout; 
     $(window).bind(
      'resize', 
      function() 
      { 
       if ($.browser.msie) { 
        // IE fires multiple resize events while you are dragging the browser window which 
        // causes it to crash if you try to update the scrollpane on every one. So we need 
        // to throttle it to fire a maximum of once every 50 milliseconds... 
        if (!throttleTimeout) { 
         throttleTimeout = setTimeout(
          function() 
          { 
           api.reinitialise(); 
           throttleTimeout = null; 
          }, 
          50 
         ); 
        } 
       } else { 
        api.reinitialise(); 
       } 
      } 
     ); 
    } 
) 

});