|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Member
Join Date: Nov 2005
Posts: 11
|
JavaScript works fine in IE, not in FireFox
This has me totally stumped. Here's the code:
********* <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>AA Groups in Central Dallas</title> <LINK REL=STYLESHEET TYPE="TEXT/CSS" HREF="main.CSS"> <script type="text/javascript" language="JavaScript"> <!-- function show(object) { if (document.layers && document.layers[object] != null) document.layers[object].visibility = 'visible'; else if (document.all) document.all[object].style.visibility = 'visible'; } function hide(object) { if (document.layers && document.layers[object] != null) document.layers[object].visibility = 'hidden'; else if (document.all) document.all[object].style.visibility = 'hidden'; } //--> </SCRIPT> </head> <body> <div id="top3"><H1 class="headerx">AA Groups in Central Dallas</H1> <span class="normal"><strong>Click on the area in which you want to find a meeting.</strong></span></div> <img src="Dal-Cen.gif" alt="" border="0" usemap="#Dal-C"> <map name="Dal-C"> <area alt="Gilbert St Group" coords="53,231,126,282" href="groups/oaklawn-traditional.htm#gilbert"> <area alt="Last House Group" coords="378,15,481,40" href="groups/last-house.htm"> <area alt="Campus Group" coords="195,32,258,82" href="groups/parkcities.htm"> <area alt="Highland Park Group" coords="36,69,148,109" href="groups/parkcities.htm"> <area alt="Upper Room Group" shape="poly" coords="160,108,153,117,140,119,139,131,232,133,225,116,188,110,174,85" href="groups/parkcities.htm"> <area alt="Solutions Group" shape="poly" coords="366,116,352,144,452,147,457,139,444,127,380,126" href="groups/lakewood-solutions.htm"> <area alt="Dallas AA Central Office" shape="poly" coords="363,106,342,145,285,145,285,97" href="office.htm"> <area alt="Lakewood Group" coords="350,154,434,203" href="groups/lakewood-solutions.htm"> <area alt="Belwood Group" coords="302,274,367,327" href="groups/deep-east-dallas.htm"> <area alt="Ebony/Ebonette Group" shape="poly" coords="319,370,356,362,352,376,254,411,263,430,223,425,243,394" href="groups/ebony-liveand-let-live.htm"> <area alt="Live and Let Live Group" coords="159,427,224,475" href="groups/ebony-liveand-let-live.htm"> <area alt="Traditional Group" coords="123,271,207,329" href="groups/oaklawn-traditional.htm"> <area alt="Don't Know Group" coords="33,317,122,389" href="groups/oaklawn-traditional.htm"> <area alt="Sunday Night Group" coords="38,455,102,504" href="groups/nooners-sunpm.htm"> <area alt="Downtown Nooners Group" shape="poly" coords="120,460,104,495,122,516,190,514,199,491,145,491" href="groups/nooners-sunpm.htm"> <area alt="Living Sober in Faith Group" coords="363,490,463,539" href="groups/ls-infaith.htm"> <area alt="Groups in North-Central Dallas" coords="166,2,352,16" href="dal-nc.htm" onmouseover="show('a')" onmouseout="hide('a')"> <area alt="Groups in Lake Highlands - NE Dallas - N Mesquite" coords="481,1,498,252" href="dal-ne.htm" onmouseover="show('b')" onmouseout="hide('b')"> <area alt="Groups in SE Dallas - S Mesquite" coords="482,307,498,553" href="dal-se.htm" onmouseover="show('c')" onmouseout="hide('c')"> <area alt="Groups in South-Central Dallas" coords="162,540,354,558" href="dal-sc.htm" onmouseover="show('d')" onmouseout="hide('d')"> <area alt="Groups in West-Central Dallas" coords="2,167,17,340" href="dal-wc.htm" onmouseover="show('e')" onmouseout="hide('e')"> </map> <div id="a" class="MAP"><br><ul><li class="black">All Accepted</li><li class="black">Chicago</li><li class="black">Clean Air</li><li class="black">Cornerstone</li><li class="black">Dallas North</li><li class="black">Greenville</li><li class="black">Keystone</li><li class="black">No Hassle</li><li class="black">North Park</li><li class="black">Omega</li><li class="black">Preston</li></ul><hr><br><span class="normal">75225 75230 75231 75240 75243 75248 75251 75254 75080 75081</span></div> <div id="b" class="MAP"><br><ul><li class="black">Casa</li><li class="black">Freedom (Mesquite)</li><li class="black">Lake Highlands</li><li class="black">The Rock (Sunnyvale)</li><li class="black">White Rock</li></ul><hr><br><span class="normal">75041 75043 75150 75214 75218 75228 75238</span></div> <div id="c" class="MAP"><br><ul><li class="black">Bruton Terrace (Mesquite)</li><li class="black">Grace (Mesquite)</li><li class="black">Living Sober in Faith</li><li class="black">Mesquite Bigtown (Balch Springs)</li></ul><hr><br><span class="normal">75149 75180 75181 75210 75215 75217 75223 75227</span></div> <div id="d" class="MAP"><br><ul><li class="black">Corinth</li><li class="black">Hi Nooners</li><li class="black">Kessler Park</li><li class="black">Town South</li></ul><hr><br><span class="normal">75104 75115 75134 75137 75203 75208 75211 75216 75224 75232 75233 75237 75241</span></div> <div id="e" class="MAP"><br><ul><li class="black">Lambda</li><li class="black">Second Tradition</li><li class="black">Standing on the Promises</li><li class="black">Whitehouse</li></ul><hr><br><span class="normal">75207 75209 75219 75220 75235 75247</span></div> <div class="zips">Neighboring<br>Groups / Zip Codes</div> <br><br> <div class="smallcx"> <p class="norm"><a href="dal.htm">Back to the Dallas County Map</a></p> <p class="norm"><a href="index.htm">HOME</a></p> </div> </body> </html> If you look here in IE, the onmouseovers work just fine; in FireFox they totally don't work at all. www.aadallas.org/dal-c.htm. THANKS for your help. Jim |
|
|
|
|
|
#2 |
|
He's No Good To Me Dead
![]() ![]() Join Date: Feb 2003
Location: Slave I
Posts: 24,095
|
Looks like you're writing code for the 4.0 browsers. Use the DOM which is cross-browser.
Also, I don't think FF supports layers so that is prob where your problem lies. |
|
|
|
|
|
#3 |
|
SitePoint Member
Join Date: Nov 2005
Posts: 11
|
Uh-oh...you've found me out
... I don't actually write JavaScript, just find applicable scripts on the WWW and modify them for my site. I'll have to go back to the drawing board, I suppose... |
|
|
|
|
|
#4 |
|
He's No Good To Me Dead
![]() ![]() Join Date: Feb 2003
Location: Slave I
Posts: 24,095
|
Yeah. Looks like the script you're using is pretty old. But the code is pretty simple. I bet it could be modified to be cross-browser compliant with the DOM pretty easily. Maybe one of our JavaScript gurus will swing by and offer some help.
|
|
|
|
|
|
#5 |
|
d^_^b
![]() ![]() ![]() Join Date: Nov 2005
Location: Gloucester, UK
Posts: 262
|
Well I'm certainly no guru, but I think this should work:
Code:
function show(objID)
{
var obj = document.getElementById(objID);
if (obj.style.visibility == 'hidden')
obj.style.visibility = 'visible';
}
function hide(objID)
{
var obj = document.getElementById(objID);
if (obj.style.visibility == 'visible')
obj.style.visibility = 'hidden';
}
|
|
|
|
|
|
#6 |
|
He's No Good To Me Dead
![]() ![]() Join Date: Feb 2003
Location: Slave I
Posts: 24,095
|
Awesome
![]() |
|
|
|
|
|
#7 |
|
SitePoint Member
Join Date: Nov 2005
Posts: 11
|
THANKS! I'll give it a shot first thing tomorrow.
Jim |
|
|
|
|
|
#8 |
|
Programming Since 1978
![]() ![]() ![]() ![]() Join Date: Sep 2005
Location: Sydney, NSW, Australia
Posts: 10,816
|
If you want to support Netscape 4 you can add the layers code back in as well. If you want to support Internet Explorer 4 you need the document.all code as well. A small number of people still use Netscape 4 but I don't think anyone uses IE4 any more.
|
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 23:00.






... I don't actually write JavaScript, just find applicable scripts on the WWW and modify them for my site. I'll have to go back to the drawing board, I suppose...






Linear Mode
