Help - Search - Members - Calendar
Full Version: js funtions in IE but not Firefox
HTMLHelp Forums > Programming > Client-side Scripting
razor_nate
This javascript functions in IE but not Firefox, can anyone tell me why?

function showOffset(object,x,y) {

if (document.layers && document.layers[object]) {

document.layers[object].left += x;

document.layers[object].top += y;

document.layers[object].visibility = 'visible';

}

else if (document.all) {

document.all[object].style.posLeft = document.all[object].offsetLeft + x;

document.all[object].style.posTop = document.all[object].offsetTop + y;

document.all[object].style.visibility = 'visible';

}

}



function hideOffset(object,x,y) {

if (document.layers && document.layers[object]) {

document.layers[object].visibility = 'hidden';

document.layers[object].left -= x;

document.layers[object].top -= y;

}

else if (document.all) {

document.all[object].style.visibility = 'hidden';

document.all[object].style.posLeft -= x;

document.all[object].style.posTop -= y;

}

}

Here is the html and css...

<style type="text/css">
.popup{font-family: Arial, Georgia, Sans-serif;
font-size: 16pt;
position: absolute;
z-index: 2;
font-weight: 600;
font-style: normal;
text-decoration: none;
text-transform: none;
font-variant: normal;
color: #FFFFFF;
background: #999933;
border: 3px groove #FFFFF0;
padding: 5px;
visibility: hidden;}

</style>

<a href="../maps_pdf/geologic/24k_maps/Amity.pdf" target="_blank" onMouseOver="showOffset('quad282',26,317)" onMouseOut="hideOffset('quad282',26,317)">Amity</a><br>

<map name="HotSpringQuads" id="HotSpringQuads">

<span id="quad282" class="popup">
Amity</span>
<area shape="poly" coords="16,283,95,284,95,385,15,386" href="../maps_pdf/geologic/24k_maps/Amity.pdf" target="_blank" alt="Amity" onMouseOver="showOffset('quad282',26,317)" onMouseOut="hideOffset('quad282',26,317)" />

</map>

<img src="../dgm_browse/HotSpring.jpg"
width="600" height="600" border="0" usemap="#HotSpringQuads" />


Any help would be appreciated! I'm new at this.






Christian J
QUOTE(razor_nate @ Oct 3 2008, 08:17 PM) *

This javascript functions in IE but not Firefox, can anyone tell me why?

Seems like a very old script, it checks if the browser supports either "document.layers" or "document.all", AFAIK the former was only supported by Netscape4 while the latter is not supported by Firefox.

What's the purpose of the script, just showing/hiding the box called "Amity"?


This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.