<script type="text/javascript">
$(document).ready(function(){
//alert(0);
var flag = true;
var height = 0;
$(window).scroll(function(){
if($(document).scrollTop()>100){
if(flag){h=$(document).scrollTop();flag=false;}
$("html,body").animate({scrollTop:height},0);
}
})
})
</script>
$(document).ready(function(){
//alert(0);
var flag = true;
var height = 0;
$(window).scroll(function(){
if($(document).scrollTop()>100){
if(flag){h=$(document).scrollTop();flag=false;}
$("html,body").animate({scrollTop:height},0);
}
})
})
</script>
本文介绍了一种使用JavaScript实现的页面滚动定位技术。当页面滚动超过一定距离时,通过记录当前滚动位置并平滑返回到先前的位置来实现特殊效果。此方法可用于创建独特的网页交互体验。
170

被折叠的 条评论
为什么被折叠?



