jScrollPane autoReinitialise and animateScroll

拟墨画扇 提交于 2019-12-08 10:19:19

问题


I have a jScrollpane (jQuery) problem

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;       
});

Thanks!

Eric


回答1:


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;       
});


来源:https://stackoverflow.com/questions/5091330/jscrollpane-autoreinitialise-and-animatescroll

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!