返回页面顶部

刚刚山寨了QQ空间里的返回顶部的效果,不过没有做onmouseover/onmouseout事件。

<a name="listhead" style="text-decoration: none; color: black;">机构列表</a>
<div id="gotop" style=" 57px; height: 34px; position: fixed; z-index: 100; bottom: 0; right: 0;">
<a href="#listhead" style="display: block;margin-right: 20px;  37px;border-radius: 5px;height: 100%;background:#F6F6F6 url(../images/gotop.jpg) no-repeat scroll left center"></a>
</div>

页面内跳转呢,还可以用这句js来实现,看需要啦。

location.hash = 'listhead';

页面内跳转原来还可以用这种方法

//参数分别是在窗口文档显示区左上角显示的文档的 x 坐标,y坐标。
window.scrollTo(0,0)

还有CSS3的这个样式:

border-radius: 5px 6px 7px 8px;

分别表示四个角内切圆的半径(注意内切圆、外接圆的定义,没学好的面壁去),依次是:

border-top-left-radius: 5px;
border-top-right-radius: 6px;
border-bottom-right-radius: 7px;
border-bottom-left-radius: 8px;

  

原文地址:https://www.cnblogs.com/realwall/p/2216405.html