【发布时间】:2012-03-26 13:42:34
【问题描述】:
我在使用 jquery 插件 smoothdivscroll 时遇到了一些问题。
基本上,我正在尝试让插件作为此页面运行:http://www.smoothdivscroll.com/demo.html
但是,我更改了 javascript,因为它需要自动滚动,但允许热点也能正常工作,但鼠标离开热点时恢复为自动滚动。
虽然下面的代码有效,但在您将触发器留在右侧后,它会“重置”回第一个 div。
有没有办法设置它从设置的位置恢复滚动?
代码:
// Initialize the plugin with no custom options
$(document).ready(function () {
// I just set some of the options
$("div#makeMeScrollable").smoothDivScroll({
mousewheelScrolling: true,
visibleHotSpotBackgrounds: "always",
autoScrollingMode: "endlessright"
});
});
//This is just to make the scroller pause...
$("#makeMeScrollable").bind("mouseover", function() {
$(this).smoothDivScroll("stopAutoScrolling");
}).bind("mouseout", function() {
$(this).smoothDivScroll("startAutoScrolling");
});
【问题讨论】:
标签: jquery html scroll smooth smooth-scrolling