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

moveto

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

moveto

A lightweight, smooth scrolling javascript library without any dependency.

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.7K
decreased by-19.98%
Maintainers
1
Weekly downloads
 
Created
Source

MoveTo

A lightweight, smooth scrolling javascript library without any dependency.

Installation

Using NPM

npm install moveTo --save

Using Yarn

yarn add moveTo

Using Bower

bower install moveTo --save

Usage

const moveTo = new MoveTo();

const target = document.getElementById('target');

moveTo.move(target);

// or register a trigger

const trigger = document.getElementsByClassName('js-trigger')[0];

moveTo.registerTrigger(trigger);

Trigger HTML markup

  <a href="#target" class="js-trigger" data-duration="300">Trigger</a>

API

move(target, options)

Scrolls to target

#### target Type: HTMLElement|Number

Target element/position to be scrolled. Target position is the distance to the top of the page

options

Type: Object

Pass custom options

addEaseFunction(name, fn)

Adds custom ease function

name

Type: string

Ease function name

fn

Type: function

Ease function. See easing.js for more ease function.

Development setup

# To install dev dependencies run:

yarn

# or

npm install

# To start the development server run:

gulp serve

# To lint your code run:

gulp scripts:lint

# To make a full new build run:

gulp build

# To run tests

yarn test tests/**

# or

npm test tests/**

Browser Support

It should work in the current stable releases of Chrome, Firefox, Safari as well as IE9 and up.

License

Copyright (c) 2017 Hasan Aydoğdu. See the LICENSE file for license rights and limitations (MIT).

Keywords

FAQs

Package last updated on 13 Mar 2017

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