• Hi

    I am trying to have a floating div block. For that i Have done following:

    In header.php (using jQuery):

    $(document).ready(function()
    {
    $(window).scroll(function()
    {
      $('#globalnav').animate({top:$(window).scrollTop()+"px" },{queue: false, duration: 350});
    });
    
    $('#close_message').click(function()
    {
      //the messagebox gets scrool down with top property and gets hidden with zero opacity
      $('#globalnav').animate({ top:"+=15px",opacity:0 }, "slow");
    });
    });

    Issue:
    This works perfectly on the landing page of the blog but on the individual post page the same thing doesn’t work. It shows me the globalnav menu but it neither scrolls nor closes. Seems like problem with my javascript ($(document).ready(function() isnt called again probably in other page) but am not sure

    Thanks

Viewing 1 replies (of 1 total)
  • Thread Starter lahoti

    (@lahoti)

    here by last statement I meant issue looks somewhere at that point cause fr the first time on landing page its fine… but not on pages/ post pages

Viewing 1 replies (of 1 total)
  • The topic ‘Javascript issue in header.php’ is closed to new replies.