Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

scroll-anchoring

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scroll-anchoring

Preserves the user's scroll position while DOM mutations change the page.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

scroll-anchoring

Scroll Anchoring preserves the user's scroll position while DOM mutations change the page.

Installation

$ npm install scroll-anchoring

Usage

import {preserveAnchorNodePosition} from 'scroll-anchoring'

const comments = document.getElementById('comments')
preserveAnchorNodePosition(document, () => {
  comments.insertAdjacentHTML('beforeend', newCommentHtml)
})

Browser support

  • Chrome
  • Firefox
  • Safari
  • Internet Explorer 11
  • Microsoft Edge

Development

npm install
npm test

See Also

  • CSS Scroll Anchoring Module Level 1
  • WICG/ScrollAnchoring
  • Chrome Platform Status - Intervention: Scroll Anchoring

License

Distributed under the MIT license. See LICENSE for details.

FAQs

Package last updated on 05 Sep 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc