How to make this javascript work well w/ other browser (working only w/ IE)

1 replies
  • WEB DESIGN
  • |
Hi everyone, I have this javascript

Code:
<script type="text/javascript"> 
        $(document).ready(function(){
            $("ul.topnav li a").mouseover(function() {
                $(this).parent().find("ul.subnav").fadeIn('slow').show(); 
                $(this).parent().hover(function() {
                }, function(){    
                    $(this).parent().find("ul.subnav").fadeOut('slow'); 
                });
            });
             $("ul.topnav li ul li a").mouseover(function() {
                $(this).parent().find("ul.subnav2").fadeIn('slow').show(); 
                $(this).parent().hover(function() {
                }, function(){    
                    $(this).parent().find("ul.subnav2").fadeOut('slow'); 
                });
            });
        });
and I used it

Code:
<li><a href="">Download</a></li> 
                    <ul class="subnav"> 
                        <li><a href="">1</a></li> 
                        <li><a href="">2</a></li> 
                                <ul class="subnav2">
                                    <li><a href="">2.1</a></li> 
                                    <li><a href="">2.2</a></li> 
                                </ul>
                        </li> 
                    </ul>
It works with IE9 only. Could someone help me explain and make it work well with other browser (special Safari & firefox)

Thank you
#browser #javascript #make #w or #work #working
  • Profile picture of the author KingOfDCP
    oh my mistake. It must be

    Code:
    <li><a href="">Download</a>                     <ul class="subnav">                          <li><a href="">1</a></li>                          <li><a href="">2</a></li>                                  <ul class="subnav2">                                     <li><a href="">2.1</a></li>                                      <li><a href="">2.2</a></li>                                  </ul>                         </li>                      </ul>
    </li>
    But could someone explain why IE9 still display right?
    {{ DiscussionBoard.errors[3931238].message }}

Trending Topics