http://www.smoothdivscroll.com的滚动功能正是我们正在寻找的,但是我们有一个特定的需要,即当您在 slider 中的图像上移动时滚动“暂停”,然后当您将鼠标移出时滚动将再次播放。目前,当您将鼠标悬停在图像上时,滚动会继续,我们如何在鼠标悬停和鼠标移出时暂停和播放它?左箭头和右箭头也是如此。一旦您与这些进行交互,滚动条就会完全停止,我们希望它在您将鼠标从箭头移开后再次自动播放。
任何帮助将不胜感激!
最佳答案
$(document).ready(function() {
$("#makeMeScrollable").smoothDivScroll({
mousewheelScrolling: true,
manualContinuousScrolling: true,
visibleHotSpotBackgrounds: "always",
autoScrollingMode: "always"
});
// Mouse over
$("#makeMeScrollable").bind("mouseover", function(){
$("#makeMeScrollable").smoothDivScroll("stopAutoScrolling");
});
// Mouse out
$("#makeMeScrollable").bind("mouseout", function(){
$("#makeMeScrollable").smoothDivScroll("startAutoScrolling");
});
});
这应该可行,在这里测试 http://jsfiddle.net/EEAFs/
关于jquery - 平滑的 Div 滚动暂停/播放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10908656/