FireFox getelemetbyID/name
Hej,Nedenstående kode viser en gif, som kan "gemmes"(visibility =hidden). Scriptet virker ok i IE, men ikke i firefox. Har læst mig fremtil at man skal bruge getelementbyid. fx.
...
var cache = (navi) ? document.getElementById("cache");
..
men uden held
<STYLE TYPE="text/css">
<!--
#cache{
z-index:10;
visibility:VISIBLE;
}
#newslist { font-size: 12px; background-color: #ffffff; display: none; position:relative; z-index: 6; left: 50px; width: 150px; border: solid 2px #b54905 }
-->
</STYLE>
<!--
Lines above are creating a layer which show a message
displaying the 'PLEASE WAIT ... ' message
-->
<DIV ID="cache"><FONT FACE="Arial, Verdana" SIZE=1><B><BR>Uploader vent...<BR></B><IMG ID="Picture80" HEIGHT=9 WIDTH=225 SRC="./images/wait.gif" BORDER=0></DIV>
<SCRIPT LANGUAGE="JavaScript">
ver = navigator.appVersion.substring(0,1)
if (ver >= 4)
{
var navi = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 4);
var HIDDEN = (navi) ? 'hide' : 'hidden';
var VISIBLE = (navi) ? 'show' : 'visible';
: document.all.cache.style;
largeur = screen.width;
cache.left = Math.round(100);
cache.visibility = VISIBLE;
}
function cacheOff()
{
if (ver >= 4)
{
cache.visibility = HIDDEN;
}
}
function cacheOn()
{
if (ver >= 4)
{
cache.visibility = VISIBLE;
}
}
</SCRIPT>
<input type=button onclick=cacheOff() value=off>
<input type=button onclick=cacheOn() value=cacheOn>