PDA

View Full Version : Image scrolling not working under Firefox



yvesm
04-05-2005, 08:02 AM
Hello,
I use an old script working fine under IE but not under Firefox (even Netscape is tested !).
The purpose is to scroll a small image all along the page.
Any one to help me ??
Many thanks
Yves

<html>
<head>

<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<title>TEST</title>

</head>
<body>

<DIV align=right class=tcnews id=tcnews
style="POSITION: absolute; TOP: 12px; width: 103px; left: 82px; height: 58px">
<DD> <FONT color=#000080><A href="test/test.html"><IMG alt="Enter"
border=0 height=32 src="test.gif"
width=85></A></FONT><FONT color=#000080><br>
<font color="#00FF00">Enter</font></FONT></DD>
</DIV>

<p>
<script>

var LA= 0;
var HO= 0;
var XX= 0;
var YY= 0;
var ZZZ= 0;
var uu= null;
var IMGL= 100;
var IMGH= 60;
var LSAFETY= 60;
var TGUARD= 20;
function smove() {
oldLA= LA;
oldHO= HO;
oldXX= XX;
oldYY= YY;
if (navigator.appName == 'Netscape') {
if ((window.innerHeight != oldHO)||(window.innerWidth != oldLA)||(window.pageXOffset != oldXX)||(window.pageYOffset != oldYY))
{
if (uu == null)
{
for (i=0; i<document.layers.length; i++)
{
uu= document.layers[i];
}
}
if (uu != null)
{
uu.visibility= "hide";
HO= window.innerHeight;
LA= window.innerWidth;
XX= window.pageXOffset;
YY= window.pageYOffset;


(HO > IMGH) ? uu.top= ((HO/3*2)+YY-(IMGH+TGUARD)) : uu.top= 0;
(LA > IMGL) ? uu.left= (LA+XX-(IMGL+LSAFETY)) : uu.left= 0;

for (i=0; i<document.layers.length; i++)
{
templay= document.layers[i];
if (templay.zIndex > ZZZ)
ZZZ= (templay.zIndex + 1);
}
uu.zIndex= ZZZ;
uu.visibility= "show";
}
}
}
else{
if (navigator.appVersion.indexOf("Mac") == -1)
{
if ((document.body.clientHeight != oldHO)||(document.body.clientWidth != oldLA)||(document.body.scrollLeft != oldXX)||(document.body.scrollTop != oldYY)) {
alldivs= document.all.tags("DIV");
if (uu == null){
for (i=0; i<alldivs.length; i++)
{
uu= alldivs(i);
}
}
if (uu != null){
uu.style.display= "none";
HO= document.body.clientHeight;
LA= document.body.clientWidth;
XX= document.body.scrollLeft;
YY= document.body.scrollTop;
uu.style.top= ((HO/3*2)+YY-(IMGH+TGUARD)+12);
uu.style.left=(LA+XX-(IMGL+LSAFETY)+15);
for (i=0; i<alldivs.length; i++){
templay= alldivs(i);
if (templay.style.zIndex > ZZZ)
uu.style.zindex= (templay.style.zIndex + 1);
}
uu.style.display= "";
}
}
}
}
}
if ((document.all) || (document.layers)){
setInterval("smove()",100);
}
</script>
</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>

</body>
</html>