New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

scroll-linkage

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scroll-linkage

## 页面元素准备

latest
npmnpm
Version
1.0.3
Version published
Weekly downloads
5
400%
Maintainers
1
Weekly downloads
 
Created
Source

常见的锚点定位页面位置--页面位置滚动联动锚点的插件

页面元素准备

1.比如导航为:语文 数学,导航为<a href="#yuwen">语文</a> <a href="#shuxue">数学</a>

2.需要有对应ID的任意和html元素,比如<div id="yuwen"></div> <div id="shuxue"></div>

依赖jquery

但项目中可能已经引入了jquery,所以不做硬性引入,以免版本不同造成的冲突。使用时请自行添加依赖

实现效果1:点击锚点,页面可以滚动

实现效果2:页面滚动到某个位置时,其对应的导航将高亮(默认加上active的class)

有问题请联系zhen0578@qq.com

Keywords

滚动

FAQs

Package last updated on 30 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts