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社交媒体悬停动画卡片特效

    一款卡片式社交分享模块,鼠标悬停在卡片上触发拉窗帘动画特效,很好看。
      列表&布局
     8730  0

    jquery响应式带进度步骤向导布局

    一款响应式带进度步骤向导布局,带有“下一步”、“上一步”按钮操作。
      列表&布局
     9794  0

    Table表格网站广告位报价布局代码

    一款table表格布局代码,主要运用了表格宽度设定、bgcolor、align、cellpadding、cellspacing等。
      列表&布局
     7922  0

    CSS网站开通VIP权限特权介绍布局代码

    一款网站会员特权开通页面模板,三种会员类型卡片式三列布局。
      列表&布局
     7865  0

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

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