BackToTop: Button “Back to top” appears when scrolling down your page

BackToTop is a plugin that adds a “Back to top” link automatically to your page.

Everything is created by the plugin. No HTML code required !!

You can easily find thousand plugins like that, but ours is more customizable than all others (go to the demonstration page to see it) !
The link is entirely skinnable with css. On the demonstration page, the link is full CSS3. But you can adapt it for IE (IE is bad, please delete it from your computer and smash your customer using it).

Optionally it can benefits from the jQuery Easing plugin in order to provide a different easing animation for the scrolling effect of the page.

Download: https://github.com/axpart/BackToTop

Demonstration:

Plugin homepage:

Implementation:

1. FIRST, INCLUDE THE CSS & JQUERY FILES

<!-- include CSS & JS files -->
<!-- CSS file -->
<link rel="stylesheet" type="text/css" href="backtotop.css" media="screen" />
<!-- jQuery files -->
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery-ui.js"></script>
<script type="text/javascript" src="BackToTop.min.jquery.js"></script>

2. MAKE A SIMPLE BACKTOTOP PLUGIN CALL

<script type="text/javascript">
$(document).ready(function(){
    // simple BackToTop plugin called
    BackToTop();
    // more complex BackToTop plugin called
    BackToTop({
        text : 'My awesome text',
        autoShow : false,
        timeEffect : 750
    });
});
</script>

Options:

textStringDefault : ‘A Back to top’ – Text written into the link
auto ShowBooleanDefault : true – Does the link appears during scrolling the page or is always displayed ?
timeEffectIntegerDefault : 500 – Duration (in ms) of the scrolling effect, from the bottom to the top of the page
effectScrollStringDefault : ‘linear – all jQueryU effects allowed
appearMethodStringDefault : ‘slide’ – How does the link appear ? Can be set to ‘fade’, ‘slide’ or empty
auto ShowOffsetIntegerDefault : 0 – Controls how many pixels the user scrolls down before the autoShow BackToTop link shows up
opacityFloatDefault : 1 – Opacity (0-1) of the BackToTop button
topIntegerDefault : 10 – In pixel, position of the BackToTop link from the top of the document

Screenshots:

Creating a JavaScript Library

I recently wrote a JavaScript library for creating random colors and color schemes, and while I foun…

s3Slider jQuery Plugin & Tutorial

The s3Slider jQuery plugin is made by example of jd`s smooth slide show script. Usage: HTML: Sample …

jQuery Optimization: Avoid Unnecessary Selector

Common subexpression elimination is a common way to optimize any programming code. Doing unnecessary…

Fading Links Using jQuery: dwFadingLinks

Earlier this month, we posted a MooTools script that faded links to and from a color during the mous…

jQuery Flash Plugin

This jQuery plugin is for embedding Flash movies. Pages are progressively enhanced when Flash and Ja…

jQuery Optimization: Optimize Selector

We can also optimize our selector other than being a bit specific on our selector. The key to optimi…

jQuery drop down menu: droppy

Quick and dirty nested drop-down menu in the jQuery style. I needed a nav like this for a recent pro…