开发者

$.scrollTo() function horizontally?

I don't really clearly understand the scrollTo() plugin fun开发者_JAVA技巧ction.

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.


Try the scrollTo documentation. You should set it up with the axis param:

$.scrollTo( '#menu', 800, {easing:'elasout', axis:'y'} );

Or, you can give the target as a hash:

$.scrollTo( '#menu', {top:0 , left:800}, {easing:'elasout'} );
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜