Scroll to Top

/*
 * Show/Hide Scroll to Top Button
 */
var to_top = jQuery("#to_top");
jQuery(window).scroll(function () {
    if (jQuery(this).scrollTop() > 350) {
        to_top.fadeIn("slow");
    } else {
        to_top.fadeOut("slow");
    }
});

/*
 * Scroll to Top Button
 */
to_top.click(function () {
    jQuery('html, body').animate({
        scrollTop: 0
    }, 1000);
    return false;
});

Leave a Reply