Html
    Css
    Js

    
                        
 * {
	margin:0;
	padding:0;
}
body {
	background:#ccc;
	height:2500px;
}
.header {
	height:90px;
	width:100%;
	background:rgba(97,105,255,0.6);
}
#nav {
	height:60px;
	width:100%;
	background:rgba(45,49,111,0.5);
}
#go_top {
	border:none;
	outline:none;
	width:40px;
	height:39px;
	position:fixed;
	bottom:50px;
	right:50px;
	display:none;
	transition:all 0.5s;
	cursor:pointer;
	background:url(../img/top_bg.png) no-repeat left top;
}
#go_top:hover {
	background:url(../img/top_bg.png) left -40px;
}
#fddiv {
	width:80px;
	height:160px;
	background:rgba(72,183,225,0.60);
	position:absolute;
	top:240px;
	right:0;
}

                        
↑上面代码改变,会自动显示代码结果 jQuery调用版本:1.11.3
 立即下载

缓动实现回到顶部超短js原生代码

0