jScrollPane div의 컨테이너 인 창의 너비가 100 인 div가 있습니다.jScrollPane resize
스크롤 창 크기 조정이 움직이지 않는다면 창에 jScrollPane 크기를 조정할 수 있습니까?
감사합니다.
jScrollPane div의 컨테이너 인 창의 너비가 100 인 div가 있습니다.jScrollPane resize
스크롤 창 크기 조정이 움직이지 않는다면 창에 jScrollPane 크기를 조정할 수 있습니까?
감사합니다.
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();
}
}
);
}
)
});
http://jscrollpane.kelvinluck.com/dynamic_height.html
http://jscrollpane.kelvinluck.com/dynamic_width.html 나는 이런 식으로 뭔가를 선호 :
$(window).resize(function(){
$.each($('.scrollcont'), function(){
var api = $(this).data('jsp');
api.reinitialise();
});
});
.
이 스크립트는 작업 중에 스크롤 컨테이너의 크기를 조정해야하는 경우에도 유용합니다.