zoukankan      html  css  js  c++  java
  • Js 回到顶部的方法

    <script type="text/javascript"><!--
    var w = 270;
    var h = 20;
    var str = "";
    var obj = document.getElementById("divStayTopLeft");
    if (obj)str = obj.innerHTML;
    if( typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat'){
    document.writeln('<DIV  style="z-index:9;right:0;bottom:0;height:'+h+'px;'+w+'px;overflow:hidden;POSITION:fixed;_position:absolute; _margin-top:expression(document.documentElement.clientHeight-this.style.pixelHeight+document.documentElement.scrollTop);">');
    }
    else {
    document.writeln('<DIV  style="z-index:9;right:0;bottom:0;height:'+h+'px;'+w+'px;overflow:hidden;POSITION:fixed;*position:absolute; *top:expression(eval(document.body.scrollTop)+eval(document.body.clientHeight)-this.style.pixelHeight);">');
    }
    document.writeln('<div style="clear:both;margin:auto;height:30px;font-size:16px;overflow:hidden;font-weight:bold;text-align:left;"><a href="javascript:scroll(0,0)" hidefocus="true"><img src="TOP图片地址" alt="" title="回到顶部" style="border: 0px;" /></a></div> ');
    document.write('<div style="clear:both;margin:auto;overflow:hidden;text-align:left;">'+str+'</div>');
    document.writeln('</DIV>');
    -->
    </script>
  • 相关阅读:
    Mac pycharm专业版安装以及破解方法
    Django 错误之 No module named ‘MySQLdb’
    archery部署
    MySQL监控内容
    mac安装神器brew
    4. 寻找两个有序数组的中位数
    7.整数反转
    2.两数相加
    1. 两数之和
    141. 环形链表
  • 原文地址:https://www.cnblogs.com/lvcao2099/p/1519668.html
Copyright © 2011-2022 走看看