All Projects → thecreation → jquery-scrollToTop

thecreation / jquery-scrollToTop

Licence: LGPL-3.0 license
A jQuery plugin that display a button for scrolling the page to the top.

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to jquery-scrollToTop

jquery-slidescrollpanel
Create sliding scroll panels that slide in by touch, trackpad and scrolling
Stars: ✭ 16 (+14.29%)
Mutual labels:  jquery-plugin
scrolltotop
Scroll To Top extension for Chrome, Firefox, Safari, Opera.
Stars: ✭ 60 (+328.57%)
Mutual labels:  scrolltotop
paginathing
a jQuery plugin to paginate your DOM easily.
Stars: ✭ 23 (+64.29%)
Mutual labels:  jquery-plugin
jquery-custom-select
Custom Select jQuery Plugin
Stars: ✭ 27 (+92.86%)
Mutual labels:  jquery-plugin
jquery-sina-emotion
一个用来方便快速地创建新浪微博表情选择对话框的jQuery插件。
Stars: ✭ 56 (+300%)
Mutual labels:  jquery-plugin
jquery-svg-convert
Convert .svg images to code on the fly with jQuery
Stars: ✭ 30 (+114.29%)
Mutual labels:  jquery-plugin
jquery-profile
jQuery plugin to profile calls to jQuery selectors.
Stars: ✭ 39 (+178.57%)
Mutual labels:  jquery-plugin
jquery.pwstrength
A jQuery plugin to indicate the strength of passwords
Stars: ✭ 22 (+57.14%)
Mutual labels:  jquery-plugin
JJ CAMP
JavaScript & jQuery 정복 CAMP × 패스트캠퍼스
Stars: ✭ 19 (+35.71%)
Mutual labels:  jquery-plugin
conditionize.js
Small jQuery plugins for handling conditional form fields via data attributes. Unmaintained.
Stars: ✭ 56 (+300%)
Mutual labels:  jquery-plugin
Facebook-Album-Browser
jQuery plugin for browsing public albums of a Facebook account
Stars: ✭ 76 (+442.86%)
Mutual labels:  jquery-plugin
fixedThead
A jQuery plug-in for fixed table header
Stars: ✭ 21 (+50%)
Mutual labels:  jquery-plugin
jquery.geocomplete
A simple plugin for Google Maps Autocomplete.
Stars: ✭ 15 (+7.14%)
Mutual labels:  jquery-plugin
cazary
jQuery plugin of WYSIWYG editor that aims for fast, lightweight, stylish, customizable, cross-browser, and multi-language.
Stars: ✭ 12 (-14.29%)
Mutual labels:  jquery-plugin
Parallaxie
Easiest, Responsive and Customizable Parallax jQuery Plugin
Stars: ✭ 65 (+364.29%)
Mutual labels:  jquery-plugin
kolorwheel.js
🌈 Color palette generator JavaScript library
Stars: ✭ 37 (+164.29%)
Mutual labels:  jquery-plugin
jquery-particles-burst
Lightweight particles generator
Stars: ✭ 21 (+50%)
Mutual labels:  jquery-plugin
desoslide
Take control of your slideshow with this powerful jQuery plugin
Stars: ✭ 68 (+385.71%)
Mutual labels:  jquery-plugin
fontIconPicker
A lightweight iconpicker for use with jQuery
Stars: ✭ 30 (+114.29%)
Mutual labels:  jquery-plugin
guillotine
jQuery plugin to crop images within an area (fully responsive), allowing to drag (touch support), zoom and rotate.
Stars: ✭ 321 (+2192.86%)
Mutual labels:  jquery-plugin

jQuery scrollToTop bower NPM version Dependency Status prs-welcome

A jquery plugin that automatically add a button to scroll to top.

Table of contents

Main files

dist/
├── jquery-scrollToTop.js
├── jquery-scrollToTop.es.js
├── jquery-scrollToTop.min.js
└── css/
    ├── scrollToTop.css
    └── scrollToTop.min.css

Quick start

Several quick start options are available:

Download the latest build

Install From Bower

bower install jquery-scrollToTop --save

Install From Npm

npm install jquery-scrollToTop --save

Install From Yarn

yarn add jquery-scrollToTop

Build From Source

If you want build from source:

git clone [email protected]:amazingSurge/jquery-scrollToTop.git
cd jquery-scrollToTop
npm install
npm install -g gulp-cli babel-cli
gulp build

Done!

Requirements

jquery-scrollToTop requires the latest version of jQuery.

Usage

Including files:

<link rel="stylesheet" href="/path/to/scrollToTop.css">
<script src="/path/to/jquery.js"></script>
<script src="/path/to/jquery-scrollToTop.js"></script>

Initialization

All you need to do is call the plugin on the element:

jQuery(function($) {
  $('body').scrollToTop({
    skin: 'cycle'
  });
});

Examples

There are some example usages that you can look at to get started. They can be found in the examples folder.

Options

jquery-scrollToTop can accept an options object to alter the way it behaves. You can see the default options by call $.scrollToTop.setDefaults(). The structure of an options object is as follows:

{
  distance: 200,
  speed: 1000,
  easing: 'linear',
  animation: 'fade', // fade, slide, none
  animationSpeed: 500,

  mobile: {
    width: 768,
    distance: 100,
    speed: 1000,
    easing: 'easeInOutElastic',
    animation: 'slide',
    animationSpeed: 200
  },

  trigger: null, // Set a custom triggering element. Can be an HTML string or jQuery object
  target: null, // Set a custom target element for scrolling to. Can be element or number
  text: 'Scroll To Top', // Text for element, can contain HTML

  skin: null,
  throttle: 250,

  namespace: 'scrollToTop'
}

Methods

Methods are called on scrollToTop instances through the scrollToTop method itself. You can also save the instances to variable for further use.

// call directly
$().scrollToTop('destroy');

// or
var api = $().data('scrollToTop');
api.destroy();

jump()

Jump to top.

$().scrollToTop('jump');

enable()

Enable the scrollbar functions.

$().scrollToTop('enable');

disable()

Disable the scrollbar functions.

$().scrollToTop('disable');

destroy()

Destroy the scrollbar instance.

$().scrollToTop('destroy');

Events

jquery-scrollToTop provides custom events for the plugin’s unique actions.

$('.the-element').on('scrollToTop::jump', function (e) {
  // on jump to top
});
Event Description
enable Fired when the enable instance method has been called.
disable Fired when the disable instance method has been called.
show Fired when showing the toggle.
hide Fired when hiding the toggle.
jump Fired when jumping to the top.
destroy Fires when an instance is destroyed.

No conflict

If you have to use other plugin with the same namespace, just call the $.scrollToTop.noConflict method to revert to it.

<script src="other-plugin.js"></script>
<script src="jquery-scrollToTop.js"></script>
<script>
  $.scrollToTop.noConflict();
  // Code that uses other plugin's "$().scrollToTop" can follow here.
</script>

Browser support

Tested on all major browsers.

Safari Chrome Firefox Edge IE Opera
Latest ✓ Latest ✓ Latest ✓ Latest ✓ 9-11 ✓ Latest ✓

As a jQuery plugin, you also need to see the jQuery Browser Support.

Contributing

Anyone and everyone is welcome to contribute. Please take a moment to review the guidelines for contributing. Make sure you're using the latest version of jquery-scrollToTop before submitting an issue. There are several ways to help out:

Development

jquery-scrollToTop is built modularly and uses Gulp as a build system to build its distributable files. To install the necessary dependencies for the build system, please run:

npm install -g gulp
npm install -g babel-cli
npm install

Then you can generate new distributable files from the sources, using:

gulp build

More gulp tasks can be found here.

Changelog

To see the list of recent changes, see Releases section.

Copyright and license

Copyright (C) 2016 amazingSurge.

Licensed under the LGPL license.

back to top

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].