$.scrollTo() 函数水平?
我不太清楚scrollTo() 插件函数。
我想做的是水平移动到特定目标(就像一个场景到另一个场景)。这是我的一些代码:
<div class="left" style="cursor:pointer;"><a href="#" onclick="$.scrollTo( '#menu', 800, {easing:'elasout'} );"> < </a></div>
<div class="right" style="cursor:pointer;"><a href="#" onclick="$.scrollTo( '#city', 800, {easing:'elasout'} );"> > </a></div>
<div class="name" style="cursor:pointer;"><a href="#" onclick="$.scrollTo( '#nature', 800, {easing:'elasout'} );" > NatureVille</a></div>
它根本不起作用。有人可以尽快简化或解释这个问题的正确方向吗?
太感谢了。 (Jquery lib 和scrollTo.js 已包含在内。)
PS 请原谅我凌乱的代码,我对此有点陌生。谢谢你的帮助。
I don't really clearly understand the scrollTo() plugin function.
What I'm trying to do is to go to the specific target horizontally (like one scene to another scene). Here's some of my codes:
<div class="left" style="cursor:pointer;"><a href="#" onclick="$.scrollTo( '#menu', 800, {easing:'elasout'} );"> < </a></div>
<div class="right" style="cursor:pointer;"><a href="#" onclick="$.scrollTo( '#city', 800, {easing:'elasout'} );"> > </a></div>
<div class="name" style="cursor:pointer;"><a href="#" onclick="$.scrollTo( '#nature', 800, {easing:'elasout'} );" > NatureVille</a></div>
It's not working at all. Could anyone kindly simplify or explain the right direction to this problem ASAP?
Thank you so much. (Jquery lib and scrollTo.js are already included.)
P.S. please excuse my messy code, I'm kinda new in this. Thx for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试
scrollTo
文档。您应该使用 axis 参数进行设置:
或者,您可以将目标作为散列给出:
Try the
scrollTo
documentation.You should set it up with the
axis
param:Or, you can give the target as a hash: