Skip to content Skip to sidebar Skip to footer

When Reaching Bottom The Button Should Hide

Am set one button on the bottom in jsp page. Using that button the page will scroll down. But i have to hide that button when the page reach bottom. this page is report page. So it

Solution 1:

Demo

jQuery

var$window = $(window),
    $document = $(document),
    button = $('.button');

button.css({
    opacity: 1
});

$window.on('scroll', function () {
    if (($window.scrollTop() + $window.height()) == $document.height()) {
        button.stop(true).animate({
            opacity: 0
        }, 250);
    } else {
        button.stop(true).animate({
            opacity: 1
        }, 250);
    }
});

Post a Comment for "When Reaching Bottom The Button Should Hide"