🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

org.webjars.bowergithub.fluorumlabs:scroll-target

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

org.webjars.bowergithub.fluorumlabs:scroll-target

WebJar for scroll-target

1.0.0
Source
Maven
Version published
Maintainers
1
Source

<scroll-target>

Live Demo ↗

<scroll-target> is a really simple web component for making scrolling easier. ll you need to do is to wrap the content you want to scroll to and call ensureVisibility():

<button onclick="document.getElementById('target').ensureVisibility()">Click me!</button>

...

<scroll-target id="target">
    <h2>I'm the content you want to see</h2>
    <p>...</p>
</scroll-target>

Properties

<scroll-target top-offset="<offset-in-pixels>">

top-offset defines a space that should be reserved for fixed top menu when scrolling. 0 by default. Can be changed in runtime by calling scrollTargetElement.setTopOffset(...).

Methods

scrollTargetElement.setTopOffset(<offset-in-pixels>);

setTopOffset defines a space that should be reserved for fixed top menu when scrolling. Can be set via top-offset attribute.

scrollTargetElement.ensureVisibility(<delay-in-milliseconds>);

ensureVisibility scrolls to make the wrapped content visible. If optional <delay-in-milliseconds> is specified, scrolling will be delayed by specified amount of time.

FAQs

Package last updated on 04 Apr 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