我在使用 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");
});