本文介绍了jScrollPane自动重新初始化并设置animateScroll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我遇到了jScrollpane(jQuery)问题
I have a jScrollpane (jQuery) problem
我在网站上使用jScrollpane.我拥有使滚动区域更大的动态内容.这使属性autoReinitialise成为必需的.我也想使用animateScroll属性,但是如果同时使用它们,滚动条会发疯(我告诉你!).
I use jScrollpane on my website. I have dynamic content that makes the scroll-area larger. This makes the attribute autoReinitialise mandatory.I also want to use the animateScroll attribute, but if I use those at the same time, the scrollbar wil go mad (mad i tell you!).
有人知道这是怎么回事吗?
Does someone know what's up with that?
http://www.bidadari.nl/?page_id=98
var pane = jQuery("#scroll_area");
pane.jScrollPane({
autoReinitialise: true,
showArrows: true,
verticalArrowPositions: "split",
horizontalArrowPositions: "split",
animateScroll: true
});
var api = pane.data("jsp");
jQuery("#button_step_right").bind("click", function() {
api.scrollByX(750);
return false;
});
谢谢!
埃里克
推荐答案
ah.正确的答案是:
ah. The correct answer was:
var pane = jQuery("#scroll_area");
pane.jScrollPane({
autoReinitialise: true,
showArrows: true,
verticalArrowPositions: "split",
horizontalArrowPositions: "split",
/// animateScroll: true
});
var api = pane.data("jsp");
jQuery("#button_step_right").bind("click", function() {
api.scrollByX(750, true); /// <- true
return false;
});
这篇关于jScrollPane自动重新初始化并设置animateScroll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!