dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: NEED HELP JS Error

Hybrid View

  1. #1
    Join Date
    Feb 2013
    Location
    Uk
    Posts
    8

    NEED HELP JS Error

    Need Help!

    I have some code below so that a div appears with my nav in when the user gets 680px down and hides again on the way back up. The problem is that on the way back up the div hides but once I get to the top of the window <0 it appears again to get rid I need to move down a few px to get rid of the div again. Whats missing!

    <script>

    $(window).scroll( function() {
    if ( $(window).scrollTop() > 680 ) {
    loadDiv2();
    }
    });

    function loadDiv2() {
    $('.nav_fade_wrapper').fadeIn('slow', function() {
    $(this).fadeTo("fast", 1);
    });
    }

    $(window).scroll(function(){
    if($(window).scrollTop() < 720){
    $(".nav_fade_wrapper").hide();
    }

    });
    </script>

  2. #2
    Join Date
    Feb 2013
    Location
    Uk
    Posts
    8
    Any body who made time to look at my post thanks, but I have sorted it!

    if anybody is interested I made the header of my site position:relative; and give this a z-index higher than the fade in div so it wasn't relying solely on JS, so this then permanently hid the div.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles