Forums

Javascript issue in header.php (2 posts)

  1. lahoti
    Member
    Posted 3 years ago #

    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

  2. lahoti
    Member
    Posted 3 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic