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合作流程步骤图文布局

    一款步骤流程介绍说明布局,从1到4点都由图文进行阐述说明。
      列表&布局
     3682  0

    DIV+CSS网站VIP会员套餐特权对比布局代码

    一款VIP套餐特效比对布局,开通不同类型的VIP介绍说明,分为三列布局。
      列表&布局
     5860  0

    CSS响应式垂直历史大事记时间线布局代码

    一款企业历史大事记布局代码,红色风格的垂直时间轴,响应式布局设计。
      列表&布局
     3767  0

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

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

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

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