jquery响应式垂直时间轴滚动锚点定位插件

所属分类: 网页特效-列表&布局    2023-07-25 02:27:51

jquery响应式垂直时间轴滚动锚点定位插件 ie兼容6
 查看演示  登录后下载 温馨提示
登录会员即可享受免费下载
 我要建站

jquery响应式垂直时间轴滚动锚点定位插件(共6个文件)

    • script.js
    • index.html
    • style.css

使用方法

$(function () {
  function sumSection() {
    return $(".container").height();
  }
  function setDimensionBar() {
    $(".bar").css({
      "height": $(window).height() / sumSection() * 100 + "%" });

  }
  function setSection() {
    $.each($("section"), function (i, element) {
      $(element).css({
        "min-height": $(window).height() });

    });
  }

  function addBehaviours() {
    let sections = $("section");
    $.each($(".node"), function (i, element) {
      $(element).on("click", function (e) {
        e.preventDefault();
        let scroll = $(sections[i]).offset().top;
        $('html, body').animate({
          scrollTop: scroll },
        500);
      });
    });
  }

  function arrangeNodes() {
    $(".node").remove();
    $.each($("section"), function (i, element) {
      let name = $(element).data("name");
      let node = $("
  • " + name + "
  • "); $(".indicator").append(node); $(node).css({ "top": $(".indicator").height() / $(document).height() * $(element).offset().top }); }); addBehaviours(); } $(window).on("scroll", function () { let top = window.scrollY / sumSection() * 100; $(".bar").css({ "top": top + "%" }); }); $(window).on("resize", function () { setSection(); arrangeNodes(); setDimensionBar(); }); setTimeout( function () { setSection(); arrangeNodes(); setDimensionBar(); }, 200); });

    站长提示:
    1. 苦力吧素材官方QQ群:950875342
    2. 平台上所有素材资源,需注册登录会员方能正常下载。
    3. 会员用户积极反馈网站、素材资源BUG或错误问题,每次奖励2K币
    4. PHP源码类素材,如需协助安装调试,或你有二次开发需求,可联系苦力吧客服。
    5. 付费素材资源,需充值后方能下载,如有任何疑问可直接联系苦力吧客服
    相关资源 / 列表&布局

    CSS侧边栏人员信息图文布局列表

    一款网页边栏人员介绍图文列表,人员头像、姓名、职称和个人介绍说,带咨询按钮。
      列表&布局
     8841  0

    纯CSS创建的会员特权套餐价格表布局

    一款会员VIP价格表布局代码,三列卡片式布局,可以清楚看到每隔套餐的功能权限和价格。
      列表&布局
     3801  0

    DIV+CSS网站会员VIP特权介绍布局代码

    一款css会员VIP特权说明布局,两栏卡片式布局。
      列表&布局
     4806  0

    CSS实现的网页底部固定DIV表单提交特效

    一款固定于页面底部浮动特效,带可关闭隐藏按钮,始终固定悬浮于网页最底部。
      列表&布局
     9861  0

    评论数(1) 回复有机会获得K币 用户协议

      kuli80
      2023-09-20 13:13:20
    😀
    • 😀
    • 😊
    • 😂
    • 😍
    • 😑
    • 😷
    • 😵
    • 😛
    • 😣
    • 😱
    • 😋
    • 😎
    • 😵
    • 😕
    • 😶
    • 😚
    • 😜
    • 😭
    发表评论