jquery 滚动条和平滑滚动代码

vzgqcmou  于 6个月前  发布在  jQuery
关注(0)|答案(1)|浏览(70)

请查看此页面(示例)

http://www.christinamichael.in/create-a-powerful-human-disintegration-effect-in-photoshop

字符串
我想知道我怎么能有这样的?
我想在火狐和Chrome支持的东西。

uujelgoq

uujelgoq1#

你可以使用锚标签进行平滑滚动。下面是结果。
$public function(){('a [href*=#]:not([href=#]否').单击function(){(location.pathname.replace(/^//,'')== this.pathname.replace(/^//,'')&& location.hostname == this.hostname){ var target = $(this.hash); target = target.length?target:$('[name=' + this.hash.slice(1)+']'); if(target.length){ $('html,body').animate({ scrollTop:target.offset().top },1000); return false; } } }); });

相关问题