J2EE社區(qū)

          茍有恒,何必三更起五更眠;
          最無益,只怕一日曝十日寒.
          posts - 241, comments - 318, trackbacks - 0, articles - 16

          微博返回頂部

          Posted on 2013-05-02 16:49 xcp 閱讀(1533) 評論(0)  編輯  收藏 所屬分類: Javascript
          <!-- 回到頂部-->
          <style>
            a.W_gotop {
             display: none;
             position: fixed;
             _position: absolute;
             width: 22px;
             height: 85px;
             line-height: 12px;
             left: 50%;
             bottom: 100px;
             margin-left: 500px;
               margin-bottom: 5px;
               background-color: #F2F2F2;
               border: 1px solid #CCCCCC;
               border-radius:2px;
               text-align: center;
               text-decoration: none;
           }
           a.W_gotop span {
             cursor: pointer;
               display: block;
               height: 73px;
               padding-top: 10px;
               border: 1px solid #FFFFFF;
               text-decoration: none;
           }
           a.W_gotop em {
               cursor: pointer;
               text-decoration: none;
               font-style: normal;
               font-weight: normal;
           }
           .icon_gotop{
              background: url(images/gotop.png) no-repeat;
           }
           .W_gotop:hover .icon_gotop {
             background: url(images/gotop_focus.png) no-repeat;
           }
           .W_ico {
            display: inline-block;
              height: 12px;
              width: 12px;
              margin-bottom: 5px;
           }
           .W_txt{
              color: #808080;
           }
          </style>
          <a id="base_scrollToTop" class="W_gotop" style="visibility: visible;">
          <span>
           <em class="W_ico icon_gotop"></em>
           <em class="W_txt">返回頂部</em>
          </span>
          </a>

          <script type="text/javascript">
          $(function(){
           var gotop = $(".W_gotop")
           gotop.click(function(){
            $("html,body").animate({scrollTop:0},500)
           });
           
           $(window).scroll(function(){
            if($.browser.msie && ($.browser.version == "6.0") && !$.support.style){//如果IE6
             gotop.css({"top":($(window).scrollTop()+$(window).height()-100)+"px","position":"absolute"});
            }
            if($(window).scrollTop()<=50){
             gotop.fadeOut();
            }else{
             gotop.fadeIn();
            }
           });
          });


          名稱: ?4C.ESL | .↗Evon
          口號: 遇到新問題?先要尋找一個方案乄而不是創(chuàng)造一個方案こ
          mail: 聯(lián)系我


          主站蜘蛛池模板: 杭州市| 光山县| 晋江市| 凭祥市| 文登市| 北京市| 新乡市| 南安市| 湘潭市| 中宁县| 景宁| 泸溪县| 巴里| 田林县| 崇信县| 永登县| 台江县| 攀枝花市| 固原市| 洪雅县| 闸北区| 杭锦后旗| 新竹县| 安塞县| 垦利县| 舟山市| 阿巴嘎旗| 专栏| 莒南县| 洛川县| 宁波市| 晋宁县| 土默特左旗| 岫岩| 灌南县| 保靖县| 珠海市| 尼木县| 青铜峡市| 武乡县| 禄劝|