jQuery Plugin For Fixed Positioned Scroll To Top Button - ap-scroll-top

jQuery Plugin For Fixed Positioned Scroll To Top Button - ap-scroll-top
File Size: 14.9 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A simple jQuery implementation of a customizable scroll to top button on your webpage for better UX.

Features:

  • Smoothly scroll the page back to the top.
  • Custom positions, animation speed and visibility trigger.
  • Auto show / hide the scroll to top button based on the scroll position.

How to use it:

1. Include jQuery library together with the jQuery ap-scroll-top plugin's JS and CSS files on the webpage.

<link rel="stylesheet" href="css/ap-scroll-top.css">
<script src="//code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="js/ap-scroll-top.js"></script>

2. Initialize the plugin and setup it with default settings.

$.apScrollTop();

3. Config the plugin with the following options.

// active the plugin
enabled: true,

// px | function,
visibilityTrigger: 100    

// in ms,        
visibilityFadeSpeed: 150         

// in ms 
scrollSpeed: 250

// custom position         
position: 'right bottom',

// must be a callback that returns a jquery element,
customButton: undefined    

// you can add your own thems       
theme: 'default'

Change log:

v0.3 (2016-05-04)

  • Supporting IE7, IE8 and IE9

This awesome jQuery plugin is developed by armin-pfaeffle. For more Advanced Usages, please check the demo page or visit the official website.