Hi everyone...
I'm developing a website for my customer and I've implemented jQuery with a simple script:
Code:
var fixed = false;
$(window).scroll(function() {
if( $(window).scrollTop() + $(window).height() == $(document).height()) {
if( !fixed ) {
fixed = true;
$('.return').fadeIn("slow");
}
} else {
if( fixed ) {
fixed = false;
$('.return').fadeOut("slow");
}
}
});
Where is the problem?
Well in the homepage all is ok no errors, when I scroll until the end of the page, the div with the link for return to top appears and when I scoll to top the div disappear.
In the second page I've implemented the same structure of the page, I've added only different text and a custom Google Maps with her API. What happens now? The script work on the contrary, when I scroll until the end of the page the div disappears and when I scroll to top this b***h appears.
What is the mistake?