zoukankan      html  css  js  c++  java
  • 锚点、target="page1"、浮标回到顶部(该点未实现,能力不足)

     <html>
    <head>
      <meta charset="utf-8">
      <title>链接</title>
    <!--
    HTML页面
    <div id="gotop"></div>
    -->  
    <!--CSS样式-->  
    <style type="css/text">
        #gotop{position:fixed;right:10px;bottom:10px;display:none}
    </style>
    <!--JavaScript脚本-->
    <script type="javascript/text">
        $(function(){
            $(window).scroll(function(){
                if($(window).scrollTop > 100){
                    $("#gotop").fadeIn(1000);//一秒渐入动画
                }else{
                    $("#gotop").fadeOut(1000);//一秒渐隐动画
                }
            });
             
            $("#gotop").click(function(){
                $('body,html').animate({scrollTop:0},1000);
            });
        });
    </script>
    
    </head>
    
    <body>
    <h1>target在目标地点打开网页</h1>
    <a href="http://www.baidu.com" target="page1">在IFRAME中打开百度首页</a>
    <a href="../character.htm" target="page1">在IFRAME中打开字符实体示例</a>
    <iframe style=" 600px; height: 300px; border: 1px solid #666;" name="page1">
    </iframe>
    
    <h1>锚点</h1>
    <table width="600px" height="20px" border="1" cellspacing="0" cellpadding="5px">
    <tr>
        <td><a href="#top">top</a></td>
        <td><a href="#center">center</a></td>
        <td><a href="#buttom">buttom</a></td>
    </tr>
    </table>
    
    <a name="top">top</a>
    <table width="600px" height="300px">
    <tr><td>111</td></tr>
    </table>
     
    <a name="center">center</a>
     
    <table width="600px" height="300px">
    <tr><td>111</td></tr>
    </table>
    
    <a name="buttom">buttom</a>
    </body>
    </html>
  • 相关阅读:
    bzoj3223: Tyvj 1729 文艺平衡树
    bzoj1014: [JSOI2008]火星人prefix
    bzoj3231: [Sdoi2008]递归数列
    bzoj2282: [Sdoi2011]消防
    bzoj3195: [Jxoi2012]奇怪的道路
    成员内部类 局部内部类 匿名内部类
    静态代码块 构造代码块
    父类子类转换
    clone()方法
    后缀表达式求值
  • 原文地址:https://www.cnblogs.com/1020182600HENG/p/6057170.html
Copyright © 2011-2022 走看看