$(function(){
//置顶按钮显示/隐藏实现
$(window).scroll(function(){
var w_height = $(window).height();//浏览器高度
var scroll_top = $(document).scrollTop();//滚动条到顶部的垂直高度
if(scroll_top > w_height){
$("#goto-top").fadeIn(500);
}else{
$("#goto-top").fadeOut(500);
}
});
//置顶
$("#goto-top").click(function(e){
e.preventDefault();
$(document.documentElement).animate({
scrollTop: 0
},200);
//支持chrome
$(document.body).animate({
scrollTop: 0
},200);
});
})
</script>
<style type="text/css">
#goto-top {
display:none;
position:fixed;
width:38px;
height:36px;
background:url(images/goto-top.png) no-repeat 0 0;
bottom:40px;
right:40px;
-webkit-transition:all 0.2s;
-moz-transition:all 0.2s;
-o-transition:all 0.2s;
transition:all 0.2s;
z-index:9999;
}
#goto-top:hover {
background:url(images/goto-top.png) no-repeat 0 -36px;
}
</style>
</head>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号