Giter Club home page Giter Club logo

smooth-scroll-jump's Introduction

smooth-scroll-jump

A lightweight, easy, straight-forward and very simple smooth scrolling link jumper made with jQuery

Demo

http://ejfrias.com/playground/smooth-scroll-jump

Requirement

jQuery 1.x and above

How to use

Just add the script before your closing </body> tag:

<script src="/path/to/smooth-scroll-jump.js"></script>

That's it! You can now add the smooth scrolling jumper to a link by using smooth-scroll-jump attribute

<a href="#content" smooth-scroll-jump>Go to content</a>

Options

All options are required to be prefixed with jump-

Name Type Default Description
animate boolean true Jumping animation which will show the smooth scrolling effect.
speed integer 500 Animation speed to milliseconds. Setting animate option to false will render speed to 0.
distance integer 20 Distance of the target element from the top of the screen in pixels.
target-attr string id If you prefer using name or other attribute than id.
change-hash boolean false Decides if the hash in the location bar should be updated.
header string (empty) Selector of the header element. By class, id, attribute, element node, etc. Scroll distance will be recalculated if the header has a fixed position.

Contributing

Since this plugin was made to be as simple as possible, requesting and/or proposing a feature would not be entertained. However, submitting bugs/issues are always welcome.

smooth-scroll-jump's People

Contributors

ejfrias avatar elvis878 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.