[Solved] when reaching bottom the button should hide [duplicate]

[ad_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);
    }
});

[ad_2]

solved when reaching bottom the button should hide [duplicate]