让 jQuery jScrollPane 在加载时自动滚动一段时间
您好,我正在寻找一种解决方案,使 jScrollPane 在页面加载时自动滚动。我发现了一些类似的问题,但它们不是我正在寻找的问题(scrollBy和scrollTo方法)。 我目前有以下内容:
$(function(){
$('.scroll-pane').jScrollPane({
showArrows: true,
autoReinitialise: true
});
});
我想要实现的是让我的水平 jScrollPane 顺利滚动我的内容(照片): 1. 向右 300px, 2.然后向左滚动300px(回到开头), 3. 最后到此为止。
有一个设置可以让我控制滚动的平滑度/持续时间/间隔也很有用。
如果您可能想知道它的用途是什么,我不希望任何观众错过他们应该滚动该区域的事实。您可以查看该网站:http://www.giamarescotti.com/v2/
非常感谢提前很久寻求任何建议。
问候, 戴夫
Hi I'm looking for a solution to make jScrollPane auto scroll on page load. I found some similar questions but they are not what I am looking for (scrollBy and scrollTo methods).
I currently have the following:
$(function(){
$('.scroll-pane').jScrollPane({
showArrows: true,
autoReinitialise: true
});
});
What I want to achieve is to have my horizontal only jScrollPane scroll my contents (photographs) smoothly:
1. To the right by 300px,
2. Then scroll back to the left by 300px (back to the beginning),
3. And finally stop there.
It is also useful to have a setting that will allow me to control the smoothness/duration/interval of the scrolling.
In case you may be wondering what the use is, I wouldn't want any viewers to miss that they are supposed to scroll that area. You may view the website at: http://www.giamarescotti.com/v2/
Thank you very much in advance for any advice.
Regards,
Dave
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
JScrollPane 支持动画。您需要添加
animateScroll
和animateDuration
(以毫秒为单位),使用scrollToX
滚动到#imagesContainer
的宽度> 然后回到 0:JScrollPane supports animation. You need to add
animateScroll
andanimateDuration
(in milliseconds), usescrollToX
to scroll to the width of the#imagesContainer
and then back to 0: