jquery hover not working properly other than IE6

jquery hover not working properly other than IE6

Hi All,

We developed a menu bar and we used jquery for mouse hover to display sub menu items. menu items are read using JS from XML. we are experiencing a problem with hover in all other browsers except IE when we hit F5.

I found that the document.ready is being fired with out loading the complete document.

  1. $(document).ready(function(){
  2. alert(" Doc Loaded"); //It prints
  3. alert($(".mainLinks").length);
  4.  // Most of the times it prints 0, some times it prints the exact count.
  5. $(".mainLinks").each(function(){
  6. $(this).hover(function() {...}}
  7. });

script files included in this order.

  1.  <script type="text/javascript" src="jquery.js"></script> 
         
    <script type="text/javascript" src="navBar.js"></script> // generates menu
     
    <script type="text/javascript" src="now.js"></script> //hover functionality

I call showNavBar("","") in the middle of jsp which generates menu. document.ready is being called first in other browsers.

Thanks | Kranthi