zoukankan      html  css  js  c++  java
  • Top 置顶小图标

    <!-- 拼命加载中... -->
    <div id="txt_loading">
    <label>{{txt_addload}}</label>
    </div>
    <!-- 拼命加载中... END-->


    <!--小小漂浮层--> <style type="text/css"> .topdiv { 60px; height: 60px; position: fixed; bottom: 50px; right: 50px; border-radius: 10px 10px 10px 10px; text-decoration: none; display: none; background-color: #999999; color: #FEFEFE; text-align: center; line-height: 60px; overflow: hidden; cursor: pointer; } </style> <div id="topdiv" class="topdiv"> Top </div> <script type="text/javascript"> //滚屏运行 $(function () { $(window).scroll(function () { //TOP顶部 //获取滚动后的高度 var scrollt = document.documentElement.scrollTop + document.body.scrollTop; var target = $('#topindex').offset().top; //目标高度 if (scrollt > target) { //判断滚动后高度超过xx就显示 $('#topdiv').fadeIn(50); //淡出 } else { $('#topdiv').stop().fadeOut(50); //如果返回或者超过,就淡入.必须加上stop()停止之前动画,否则会出现闪动 } //可视高度 var h = document.documentElement.clientHeight; if (h + scrollt > $('#txt_loading').offset().top + $('#txt_loading').height()) { //延迟加载 $Common.Func.DelayedLoadingCallBack(function () { }); } }); $('#topdiv').click(function () {//当点击标签的时候,使用animate在200毫秒的时间内,滚到顶部 var target = $('#topindex').offset().top; //目标高度 $("html,body").animate({ scrollTop: target }, 50); }); }); </script> <!-- 小小漂浮层 END-->
  • 相关阅读:
    旧题复习{6}
    CF219D. Choosing Capital for Treeland [树形DP]
    POJ1947 Rebuilding Roads[树形背包]

    洛谷P1280 尼克的任务[DP]
    NOIP2003pj栈[卡特兰数]
    NOIP2001统计单词个数[序列DP]
    洛谷P1415 拆分数列[序列DP 状态 打印]
    POJ2828 Buy Tickets[树状数组第k小值 倒序]
    CF380C. Sereja and Brackets[线段树 区间合并]
  • 原文地址:https://www.cnblogs.com/OleRookie/p/5353834.html
Copyright © 2011-2022 走看看