scrollUp jQuery plugin

Posted January 22, 2013 10:21 pm , in ,

scrollupHeroColour

ScrollUp is a lightweight jQuery plugin to create a customisable “Scroll to top” feature that will work with any website, with ease.

Recently whilst working on a client project I was required to implement a “Scroll to top” feature to make it easy for the user to get back to the top of the page. I decided to take this further and turn it into a fully customisable jQuery plugin to work with any site.

Update 08/04/2013: ScrollUp updated to v1.1. Read more here.

How to use

Simply include the jquery.scrollUp.min.js file and place the following in the head of your document (make sure jQuery is included):

Minimum setup

$(function () {
    $.scrollUp();
});

Example with default options

$(function () {
    $.scrollUp({
        scrollName: 'scrollUp', // Element ID
        topDistance: '300', // Distance from top before showing element (px)
        topSpeed: 300, // Speed back to top (ms)
        animation: 'fade', // Fade, slide, none
        animationInSpeed: 200, // Animation in speed (ms)
        animationOutSpeed: 200, // Animation out speed (ms)
        scrollText: 'Scroll to top', // Text for element
        activeOverlay: false, // Set CSS color to display scrollUp active point, e.g '#00FFFF'
    });

});

activeOverlay

To create a visible line to help determin an ideal scroll distance from the top, assign a valid CSS colour to the activeOverlay setting. This could be HEX, HSLA or RGB(A). Example: activeOverlay: '#00FFFF'. See the demo for an example.

activeoverlay

Fully Customisable

ScrollUp is fully customisable through CSS which makes it simple to fit right into your project. Simply target the scrollUp’s generated ID in your CSS file and set your styles. Below is a basic style example:

#scrollUp {
    bottom: 20px;
    right: 20px;
    padding: 10px 20px;
    background: #555;
    color: #fff;
}	

Check out the demo for more style and feature examples.

Leave your thoughts below or Tweet me @markgdyr

← Back to posts
  • Brendan Smith

    GIthub! Go throw it on github, then we can all Star it!

    • markgdyr

      Hey Brendan, if you follow the download links it will take you to the GitHub page :)

      Mark

  • http://twitter.com/paulholstein80 Paul Holstein

    Great nifty piece of code! Thank you for Sharing.

  • http://mintik.com/ mintik

    Useful plugin. Thanks :)

  • dakiquang

    Good job

  • hahala

    very good! i like it , i love cod.Thank you .

  • Paolo

    Thank you for sharing. This is great! Firefox 19 causes the “TAB” variant to jump to the right slightly on hover. I’m trying to figure out how to stop the jump – any ideas?

    • markgdyr

      Hey Paolo,

      I’ve not seen this yet, but I’ll take a look into it to see if I can find the problem :)

  • Annonces

    Really simple plugin easy to install in any CMS. Great job !