我想提供一个网页,有固定位置和Z-index999。
The goal is to make the div stay on top and all the other content scroll. I got this working properly, however i want to make it "more smooth" with easing, but everything i try makes the script stop working. This is the working script:
$(document).ready(function(){
$( a[href*=#] ).click(function() {
if (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) {
var targetOffset = $target.offset().top;
$( html,body )
.animate({scrollTop: targetOffset}, 1000) ;
return false;
}
}
});
});`
任何人都能够帮助我放松感? 我希望,在接近 anchor点时,roll势会迅速放缓。
thanks in advance.