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

dom-scroll-into-view

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dom-scroll-into-view

scroll dom node into view automatically

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is dom-scroll-into-view?

The 'dom-scroll-into-view' npm package provides utilities to smoothly scroll a DOM element into view within its container. It offers customizable options to control the alignment and behavior of the scrolling action.

What are dom-scroll-into-view's main functionalities?

Basic Scroll Into View

This feature allows you to scroll a specific DOM element into view within its container. The example demonstrates how to scroll an element with the ID 'targetElement' into view within the document body.

const scrollIntoView = require('dom-scroll-into-view');
const element = document.getElementById('targetElement');
scrollIntoView(element, document.body);

Custom Alignment

This feature allows you to customize the alignment of the element when it is scrolled into view. The example shows how to align the element with the top of the container.

const scrollIntoView = require('dom-scroll-into-view');
const element = document.getElementById('targetElement');
scrollIntoView(element, document.body, { alignWithTop: true });

Smooth Scrolling

This feature enables smooth scrolling when bringing an element into view. The example demonstrates how to scroll the element smoothly into view within the document body.

const scrollIntoView = require('dom-scroll-into-view');
const element = document.getElementById('targetElement');
scrollIntoView(element, document.body, { behavior: 'smooth' });

Other packages similar to dom-scroll-into-view

Keywords

FAQs

Package last updated on 12 Aug 2019

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