点击返回头部

当向下滚动时,出现返回头部字样,点击即可返回头部

附诗一首,enjoy youself!



<!DOCTYPE HTML>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>滚动测试</title>
    <style>
        .jump-top-box{
            width: 80px;
height:80px;
            position: fixed;
            z-index: 999;
            bottom:50px;
right:50px;
            display: block;
border-radius:50%;
        }
        .jump-top a{
            background: #df9;
            color: #000;
            font-size: 12px;
            text-decoration: none;
            display: block;
            padding: 6px 8px 8px;
            height: 26px;
            width: 26px;
            line-height: 14px;
            position: absolute;
            z-index: 2;
            left: 0;
            top: 0;
            overflow: hidden;
border: 1px dashed #000000;
            border-radius: 50%;
        }
div {
font-size: 20px;
font-family: "Courier New", Courier, monospace;
}
    </style>
    <script>
        window.onload = function () {
            function scrollFunc(){
                var back = document.getElementById("back");
                if( window.pageYOffset!=0){
                   back.style.visibility ="visible";
                }else{
                    back.style.visibility ="hidden";
                }
            }
            if(document.addEventListener){
                document.addEventListener('DOMMouseScroll',scrollFunc,false);
            }//W3C
            window.onmousewheel=document.onmousewheel=scrollFunc;//IE/Opera/Chrome/Safari
        }
    </script>
</head>
 
<body style="height:2000px">


<div>
<pre>


Do not go gentle into that good night, 
Old age should burn and 1)rave at close of day; 
Rage, rage against the dying of the light.


不要温和地走进那个良夜, 
白昼将尽,暮年仍应燃烧咆哮; 
怒斥吧,怒斥光的消逝。
 
Though wise men at their end know dark is right, 
Because their words had 2)forked no lightning they 
Do not go gentle into that good night.


虽然在白昼尽头,智者自知该踏上夜途, 
因为言语未曾迸发出电光,他们 
不要温和地走进那个良夜。
 
Good men, the last wave by, crying how bright 
Their frail deeds might have danced in a green bay, 
Rage, rage against the dying of the light.


好人,当最后一浪过去,高呼着他们脆弱的善行 
本来也许可以在绿湾上快意地舞蹈, 
所以,他们怒斥,怒斥光的消逝。
 
Wild men who caught and sang the sun in flight, 
And learn, too late, they grieved it on its way, 
Do not go gentle into that good night.


狂人抓住稍纵即逝的阳光,为之歌唱, 
并意识到,太迟了,他们过去总为时光伤逝, 
不要温和地走进那个良夜。
 
3)Grave men, near death, who see with blinding sight 
Blind eyes could blaze like 4)meteors and be gay, 
Rage, rage against the dying of the light.


严肃的人,在生命尽头,用模糊的双眼看到 
失明的眼可以像流星般闪耀,欢欣雀跃, 
所以,他们怒斥,怒斥光的消逝。
 
And you, my father, there on the sad height, 
Curse, bless, me now with your fierce tears, I pray. 
Do not go gentle into that good night. 
Rage, rage against the dying of the light. 
 
而您,我的父亲,在生命那悲哀之极, 
我求您现在用您的热泪诅咒我,祝福我吧 
不要温和地走进那个良夜。 
怒斥吧,怒斥光的消逝。
</pre>
</div>

<div class="jump-top-box">
    <div id="back" class="jump-top" style="visibility: hidden;">
        <a href="#" target="_self" >返回顶部</a>
    </div>
</div>
</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值