Giter Site home page Giter Site logo

jquery.totop's Introduction

jQuery - toTop()

A simple, highly customizable and ultra light-weight (~1KB) plugin for smoothly Scroll back to Top.


View Demo

How to Use:


1. At first include jQuery and jquery.toTop.js

  <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
  <script src="jquery.toTop.min.js"></script>

2. Include HTML

  <a class="to-top">Top &uarr;</a>

You can add any html element, and style it as you want

3. Activate the Plugin

  //basic activation - with all default values
  $('.to-top').toTop();

Options:


Option Value Desciption
autohide boolean You have options whether you want your button to hide automatically or not. You can choose 'true' or 'false'. default: true
offset Integer (px) Scrolling length from top to hide automatically. default: 420
speed Integer (ms) The duration for scroll and fade speed. default: 500
position boolean You have this option whether you want to add custom position in css. Set this 'false' if you want to add custom position with your own css. default: true
right Integer (px) Position from right. (It will work only if 'position' is set 'true'.) default: 15
bottom Integer (px) Position from bottom. (It will work only if 'position' is set 'true'.) default: 30

Plugin activation with options

  $('.to-top').toTop({
      //options with default values
      autohide: true,
      offset: 420,
      speed: 500,
      position: true,
      right: 15,
      bottom: 30
  });

Changelog:


v1.1

  • Options added for custom positioning.

v1.0

  • Initial Release

License


This plugin is licensed under MIT

jquery.totop's People

Contributors

mmkjony avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  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.