简体   繁体   中英

smooth scroll with waypoints jquery(animation)

I'm trying to make a smooth scrolling in my new website.

Look at this site: http://asher-gallery.com/

There is 3 blocks that I want to link to "a href=#(.*)" that I could make smooth scroll same like that: http://asher-gallery.com/1/ .

I change the parameters and its moving to the block location but not with animate...

I hope you guys may help me with this !

THX!

如果将其包装在click事件中,则类似的东西应该起作用

$("html, body").animate({ scrollTop: $('#element-to-scroll-to').offset().top }, 300);

CSS类不能以数字开头,如果您的类类似于class =“ 1” ,则代码将被忽略。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM