HTML实现置顶操作
需要引入JQuery,案例中引入的是jquery-1.11.2.min.js
需要图片
以下为案例源码:
--------------------------------------
html>
火箭置顶#rocket-to-top div{
left:0;margin:0;
overflow:hidden;
padding:0;position:absolute;
top:0;width:149px;
}
#rocket-to-top .level-2{
background:url("img/rocket_button_up2.png") no-repeat scroll -149px 0 transparent;
display:none;height:250px;opacity:0;z-index:1;
}
#rocket-to-top .level-3{
background:none repeat scroll 0 0 transparent;
cursor:pointer;
display:block;
height:150px;
z-index:2;
}
#rocket-to-top{
background:url("img/rocket_button_up.png") no-repeat scroll 0 0 transparent;
cursor:default;
display:block;height:250px;margin:-125px 0 0;
overflow:hidden;
padding:0;
position:fixed;
right:0;top:80%;width:149px