Javascript not working in Firefox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hollopeterb
    New Member
    • Mar 2009
    • 4

    Javascript not working in Firefox

    my javascript code works great in IE but not in Firefox, can anyone help? Thanks!! Here is the code:
    Code:
    <script type="text/javascript">
    <!--
    function MM_findObj(n, d) { //v3.0
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
    }
    
    function MM_showHideLayers() { //v3.0
      var i,p,v,obj,args=MM_showHideLayers.arguments;
      for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
        if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
        obj.visibility=v; }
    }
    
    //-->
    </script>
    Code:
    <div id="novosti" style="position:absolute; left:121px; top:175px; width:83px; height:15px; z-index:13" onmouseover="MM_showHideLayers('galery2','','hide','magazin2','','hide','novosti2','','show','tutorijali2','','hide','digitalarts2','','hide')"> 
      <p><font face="Eras Bold ITC" style="font-size: 12pt">
    	<a style="text-decoration: none" href="index2.htm">Home</a></font></p>
      </div>
    
    <!--Industrial Tab-->
    <div id="magazin" style="position:absolute; left:273px; top:175px; width:100px; height:15px; z-index:10" onmouseover="MM_showHideLayers('galery2','','hide','magazin2','','show','novosti2','','hide','tutorijali2','','hide','digitalarts2','','hide')"> 
      <p><p><font face="Eras Bold ITC" style="font-size: 12pt">
    	<a href="#" style="text-decoration: none">Industrial</a></p></font>
      </div>
    <div id="magazin2" style="position:absolute; left:273px; top:196px; height:25px; z-index:12; visibility: hidden; width:147px"> 
      <table width=147 border="0" cellspacing="0" cellpadding="5" bgcolor=#333333>
         <tr> 
          <td><span><p><font face="Eras Medium ITC" size="2"><a href=Machinery.htm>Machinery</a></font></span></p>
    		</td>
        </tr>
        <tr> 
          <td> 
    		<p><font face="Eras Medium ITC" size="2"><a href=UsedMachinery.htm>Used Machinery</a> </font></p>
    		</td>
        </tr>
        <tr> 
          <td> 
    		<p><font face="Eras Medium ITC" size="2"><a href=StandingTimber.htm>Standing Timber</a> </font></p>
    		</td>
        </tr>
         <tr> 
          <td>
    		<p><font face="Eras Medium ITC" size="2"><a href=Millwork.htm>Millwork</a> </font></p>
    		</td>
        </tr>
         <tr> 
          <td>
    		<p><font face="Eras Medium ITC" size="2"><a href=HardwoodFlooring.htm>Hardwood Flooring</a> </font></p>
    		</td>
        </tr>
      </table>
    </div>
    
    <!--END of Industrial Tab-->
    
    <div id="galery" style="position:absolute; left:414px; top:175px; width:171px; height:16px; z-index:8" onmouseover="MM_showHideLayers('galery2','','show','magazin2','','hide','novosti2','','hide','tutorijali2','','hide','digitalarts2','','hide')"> 
      <p><font face="Eras Bold ITC" style="font-size: 12pt">
    	<a href="#" style="text-decoration: none">Hardwood Items</a></font></p>
      </div>
    
    <div id="galery2" style="position:absolute; left:414px; top:197px; width:171px; height:20px; z-index:9; visibility: hidden"> 
      
      
      <table width=145 border="0" cellspacing="0" cellpadding="5" bgcolor=#333333>
         <tr> 
          <td><span><p><font face="Eras Medium ITC" size="2"><a href=Cart/CellValets/OpeningPage.htm>Charging Stations</a></font></span></p>
    		</td>
        </tr>
        <tr> 
          <td> 
    		<p><font face="Eras Medium ITC" size="2"><a href=Cart/DogCages.htm>Dog/Pet Crates</a> </font></p>
    		</td>
        </tr>
        <tr> 
          <td> 
    		<p><font face="Eras Medium ITC" size="2"><a href=Cart/DogGates.htm>Dog/Pet Gates</a> </font></p>
    		</td>
        </tr>
         <tr> 
          <td>
    		<p><font face="Eras Medium ITC" size="2"><a href=Cart/StorageServer.htm>Storage Servers</a> </font></p>
    		</td>
        </tr>
      </table>
    </div>
    
    
    
    <div id="tutorijali" style="position:absolute; left:598px; top:175px; width:146px; height:15px; z-index:15" onmouseover="MM_showHideLayers('galery2','','hide','magazin2','','hide','novosti2','','hide','tutorijali2','','show','digitalarts2','','hide')"> 
      <p><a href=AboutUs.htm style="text-decoration: none">
    	<font size="3" face="Eras Bold ITC">About Us</font></a></p>
      </div>
    
    
    
    
    <div id="digitalarts" style="position:absolute; left:776px; top:175px; width:126px; height:16px; z-index:17" onmouseover="MM_showHideLayers('galery2','','hide','magazin2','','hide','novosti2','','hide','tutorijali2','','hide','digitalarts2','','show')"> 
      <p><a href=ContactUs.htm style="text-decoration: none">
    	<font face="Eras Bold ITC" size="3">Contact Us</font></a></p>
      </div>
    Last edited by Frinavale; Mar 24 '09, 02:57 PM. Reason: Added [code] tags. Please post code in [code] [/code] tags.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    does firefox' error console say something?

    Comment

    • hollopeterb
      New Member
      • Mar 2009
      • 4

      #3
      Warning: Unknown property 'text-underline-style'. Declaration dropped.
      Source File: http://www.medinatractor.com/Specials/SalesSpecials.htm
      Line: 0

      this is all that is in the console......th anks

      OOOOPS NEVERMIND, DIFFERENT WEBSITE THERE....THERE IS NOTHING IN THE ERROR CONSOLE, I CLEARED AND RELOADED THE WEBPAGE IN QUESTION. SORRY!
      Last edited by hollopeterb; Mar 24 '09, 03:07 PM. Reason: ERROR

      Comment

      • hollopeterb
        New Member
        • Mar 2009
        • 4

        #4
        javascript in FF

        Originally posted by Dormilich
        does firefox' error console say something?

        any ideas? the console didnt come up with any errors. thanks!

        Comment

        • Dormilich
          Recognized Expert Expert
          • Aug 2008
          • 8694

          #5
          what exactly do you expect to work, that's not working?

          Comment

          • hollopeterb
            New Member
            • Mar 2009
            • 4

            #6
            the menu animation is not showing up, its a dropdown menu. you can see in person at www.lattasburglumberworks.com

            try it in IE then in Firefox, the alignment is messed up as well. thanks for any input you may have!

            Comment

            • Dormilich
              Recognized Expert Expert
              • Aug 2008
              • 8694

              #7
              the problem with that is, that I'd need Windows to run IE, which I haven't.

              though I can say some general things:
              • <font> is deprecated for quite a long time now, CSS is better suited for that
              • too many tables
              • IE uses a non-standard box model (width(ie) = width(w3c) + padding + border)
              • never assume IE display is correct (although it can be)
              • be careful when using absolute positioning

              the current technique for a dropdown (as far as I know) is the CSS driven Suckerfish Dropdown (if you want to try it)

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #8
                It seems to work well in Firefox. The alignment is messed up but that's a CSS problem.

                I'd also echo what Dormilich said: don't use IE as a benchmark if you want cross-browser compatibility.

                Comment

                Working...