Click to See Complete Forum and Search --> : netscape...


Justin
06-13-2003, 05:49 PM
how would you make this compadible with netscape

<html><head><title>ENTER</title>
<script language="javascript">
if(navigator.appName == "Netscape"){var net = "yes"}
var space=1;
function eye(){
if(net == "yes"){
alert("This is supposed to skip to the other side of your screen, but because you have netscape it doesn't work.")
}else{
if(space == 1){document.all.fire.style.left = parseInt(document.all.fire.style.left) -650; setTimeout("space=2;",'50')}
if(space == 2){document.all.fire.style.top = parseInt(document.all.fire.style.top) -300; setTimeout("space=3;",'50')}
if(space == 3){document.all.fire.style.left = parseInt(document.all.fire.style.left) +650; setTimeout("space=4;",'50')}
if(space == 4){document.all.fire.style.top = parseInt(document.all.fire.style.top) +300; setTimeout("space=1;",'50')}
}
}


</script>
</head>
<BODY background="back.jpg" link="black" Vlink="black">
<div id="fire" style="position: absolute; left: 680px;
top: 290px;" OnMouseover="eye()"><img src="fireeye.gif"></div>
</body></html>

Khalid Ali
06-13-2003, 06:54 PM
from the looks of it....

change all instances of

document.all.fire

with this

document.getElementById("fire")

the rest remains the same and it will work with all generation 6+ browsers

Justin
06-14-2003, 06:15 AM
if(space == 1){document.all.fire.style.left = parseInt(document.all.fire.style.left) -650; setTimeout("space=2;",'50')}

would you go like this...

if(space == 1){document.getElementById("fire") = parseInt(document.getElementById("fire") ) -650; setTimeout("space=2;",'50')}

if so how would you tell it to go -650 px to the left

Khalid Ali
06-14-2003, 07:35 AM
this

if(space == 1){document.getElementById("fire") = parseInt(document.getElementById("fire") ) -650; setTimeout("space=2;",'50')}


seems correct..as for -650 you will have to see that how does it look and set the left or right there is only few pixels rendering difference between NS and IE browsers....
One more thing add
+ "px"; at the end of a statement something like this

if(space == 1){document.getElementById("fire") =( parseInt(document.getElementById("fire") ) -650) + "px"; setTimeout("space=2;",'50')}