如何解除绑定jquery.scrollTo插件?
我在此页面上使用 jquery rollto 插件: http://tinyurl.com/3l49ccu)
当我调整窗口大小时,滚动不再起作用,因为“偏移”设置发生了变化。我想在调整大小时重新定义此设置。
该插件的作者在本页的评论中解释了“如何解除绑定”: http://flesler.blogspot.com/2008/03/jqueryserialscroll-110-released.html
但我没能成功 工作。
我尝试过这个:
$(window).bind("resize", function(){
$('#sideshow').unbind('.serialScroll');
}
谢谢
仍在调查...... 我在这里问过这个问题: http://forum.jquery.com/topic /如何重置serialscroll-settings-on-window-resize
I use the jquery scrollto plugin on this page : http://tinyurl.com/3l49ccu)
When i resize the window, the scroll is not working anymore because the "offset" setting changed. I would like to redefine this setting on resize.
The author of the plugin explain "how to unbind" in the comments of this page : http://flesler.blogspot.com/2008/03/jqueryserialscroll-110-released.html
but i couldn't make it work.
i tried this :
$(window).bind("resize", function(){
$('#sideshow').unbind('.serialScroll');
}
thanks
still investigating…
i asked about this problem here :
http://forum.jquery.com/topic/how-to-reset-serialscroll-settings-on-window-resize
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这样做..删除
.
do in this way..remove
.
点是正确的,因为
unbind('.serialScroll')
删除所有名称间隔事件。尽管如此,我还是无法解决这个问题。我注意到的一件事是,行$("#slideshow p").css("width", (parseInt(slideshowWidth)-2) + "px");
导致p 调整大小时展开。我注意到的另一件事是该插件使用#slideshow 的scrollLeft 属性来调整幻灯片的位置。我在浏览器中编辑时尝试了以下步骤但没有成功。也许您在编辑本地文件时运气更好:
$('#sideshow').unbind('.serialScroll');
取消绑定所有serialscroll事件,我的主要问题是幻灯片动画到第一张图片。设置scrollLeft属性是没有用的,因为它立即被动画覆盖。我无法弄清楚如何立即停止动画,所以我把这个留给你。
祝你好运
The dot is correct, because
unbind('.serialScroll')
removes all name spaced events. Still, I could not get around the problem. One thing I noticed is, that the line$("#slideshow p").css("width", (parseInt(slideshowWidth)-2) + "px");
causes the width of the p expand on resize.Another thing I noticed was that the plugin uses the scrollLeft property of the #slideshow to adjust the position of the slideshow. I tried the following steps but did not succeed, while editing in browser. Maybe you have more luck when editing your local files:
$('#sideshow').unbind('.serialScroll');
My main problem was that the slideshow animated to the first picture. Setting the scrollLeft property was useless, because it was instantly overriden by the animation. I was not able to figure out how to stop the animation in no time, so I leave this to you.
Good luck