jQuery网站右侧悬浮楼层滚动导航代码

[复制链接]
查看1278 | 回复0 | 2021-2-24 10:20 | 显示全部楼层 |阅读模式

jQuery网站右侧悬浮楼层滚动导航代码

jQuery网站右侧悬浮楼层滚动导航代码


jQuery网站右侧悬浮楼层滚动导航代码是一款全屏的悬浮导航菜单控制页面滚动跳转楼层效果,还显示滚动百分比。

  1. 部分js代码

  2. <script>
  3. (function () {
  4.                
  5.    //////////////////////
  6.         // Utils
  7.   //////////////////////
  8.     function throttle(fn, delay, scope) {
  9.         // Default delay
  10.         delay = delay || 250;
  11.         var last, defer;
  12.         return function () {
  13.             var context = scope || this,
  14.                 now = +new Date(),
  15.                 args = arguments;
  16.             if (last && now < last + delay) {
  17.                 clearTimeout(defer);
  18.                 defer = setTimeout(function () {
  19.                     last = now;
  20.                     fn.apply(context, args);
  21.                 }, delay);
  22.             } else {
  23.                 last = now;
  24.                 fn.apply(context, args);
  25.             }
  26.         }
  27.     }

  28.     function extend(destination, source) {
  29.         for (var k in source) {
  30.             if (source.hasOwnProperty(k)) {
  31.                 destination[k] = source[k];
  32.             }
  33.         }
  34.         return destination;
  35.     }
  36. </script>
复制代码


jQuery网站右侧悬浮楼层滚动导航代码.zip (36.54 KB, 下载次数: 601)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

UID
436
贡献
4
丢币
318
主题
163
回帖
1
注册时间
2021-2-21
最后登录
2023-3-12