Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder
    Join Date
    Sep 2011
    Seveso, Italy
    Thanked 2 Times in 2 Posts

    Question scrollTop malfunction

    Hi everyone...

    I'm developing a website for my customer and I've implemented jQuery with a simple script:
    var fixed = false;
    $(window).scroll(function() {
    	 if( $(window).scrollTop() + $(window).height() == $(document).height()) {
            if( !fixed ) {
                fixed = true;
        } else {
            if( fixed ) {
                fixed = false;
    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?
    Last edited by ManuelVRC; 01-12-2013 at 11:41 PM.


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts