smooth-scroller

WebJar for smooth-scroller

License

License

MIT
Categories

Categories

Github Development Tools Version Controls
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

github-com-firstandthird-smooth-scroller
Last Version

Last Version

0.1.2
Release Date

Release Date

Type

Type

jar
Description

Description

smooth-scroller
WebJar for smooth-scroller
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/firstandthird/smooth-scroller

Download github-com-firstandthird-smooth-scroller

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/github-com-firstandthird-smooth-scroller/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>github-com-firstandthird-smooth-scroller</artifactId>
    <version>0.1.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/github-com-firstandthird-smooth-scroller/
implementation 'org.webjars.bower:github-com-firstandthird-smooth-scroller:0.1.2'
// https://jarcasting.com/artifacts/org.webjars.bower/github-com-firstandthird-smooth-scroller/
implementation ("org.webjars.bower:github-com-firstandthird-smooth-scroller:0.1.2")
'org.webjars.bower:github-com-firstandthird-smooth-scroller:jar:0.1.2'
<dependency org="org.webjars.bower" name="github-com-firstandthird-smooth-scroller" rev="0.1.2">
  <artifact name="github-com-firstandthird-smooth-scroller" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='github-com-firstandthird-smooth-scroller', version='0.1.2')
)
libraryDependencies += "org.webjars.bower" % "github-com-firstandthird-smooth-scroller" % "0.1.2"
[org.webjars.bower/github-com-firstandthird-smooth-scroller "0.1.2"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.bower : jquery jar [1,2)

Project Modules

There are no modules declared in this project.

Smooth-scroller

npm

A tiny, ES6 JavaScript lib to handle smooth scrolling.

Installation

npm install smooth-scroller

Usage

See the full example.

Javascript

import 'smooth-scroller';

HTML

<a href="#foo" data-smooth>Scroll Smoothly</a>
...some content...
<div id="foo"></div>

Events

Custom events are fired on the element:

Event Description
smoothscroll:start Smooth scroll starts
smoothscroll:end Smooth scroll ends

Methods

Smooth-scroller exposes two methods:

init([selector='[data-smooth]'], [offset=0])

Enables smooth-scroller on the elements matched by selector.

Parameters

selector='[data-smooth]' - {String} - Elements that will trigger smooth-scroll call once they're clicked

offset=0 - {Number} - Controls the distance (negative or positive) between the top border of the element and the top border of the window.

scroll(target, hash, [offset=0], [silent=false])

target - {string|Element|NodeList} - Target element to scroll

hash - {string|Element|NodeList} - DOM element ID to scroll

offset=0 - {Number} - Controls the distance (negative or positive) between the top border of the element and the top border of the window.

silent=false - {Boolean} - If enabled, will generate a history.pushState event

org.webjars.bower

First+Third

We build things... awesome things.

Versions

Version
0.1.2