Hvorfor rykker den banner2 2 pixel ned?
Hej!Det her virker ok, men når det ruller, så kommer andet banner ind rykket to ned, hvorfor sker dete? Kan det rettes og hvordan?
Banner ligger i et dir: img (de findes fint, men hvad skyldes nedrykningen. De enkelte banner har samme str.
_____
bannerURLs = new Array("http://www.cc.com","http://www.vv.com","http://www.bb.com");
}
function moveBanner(){
if(!wait){
banner1.style.left = parseInt(banner1.style.left) - (speed * 5);
banner2.style.left = parseInt(banner2.style.left) - (speed * 5);
if(parseInt(banner1.style.left) <= -500){
banner1.style.left = 500;
bannerIndex = (bannerIndex < (bannerLocations.length - 1)) ? ++bannerIndex :0;
banner1.src = bannerLocations[bannerIndex];
link1.href = bannerURLs[bannerIndex];
wait = true;
}
if(parseInt(banner2.style.left) <= -500){
banner2.style.left = 500;
bannerIndex = (bannerIndex < (bannerLocations.length - 1)) ? ++bannerIndex :0;
banner2.src = bannerLocations[bannerIndex];
link2.href = bannerURLs[bannerIndex];
wait = true;
}
setTimeout("moveBanner()",100);
} else {
wait = false;
setTimeout("moveBanner()", displayTime * 1000);
}
}
-->
</script>
</HEAD>
<body onLoad="initVar(); moveBanner()" topmargin="0" leftmargin="0">
<div align="center">
<div name="addbox" id="addbox">
<a name="link1" id="link1" href="http://www.cc.com" target="_blank"><img border="0" name="banner1" id="banner1" src="../img/banner1.jpg"></a>
<a name="link2" id="link2" href="http://www.vv.com" target="_blank"><img border="0" name="banner2" id="banner2" src="../img/banner2.jpg"></a>
<a name="link3" id="link3" href="http://www.bb.com" target="_blank"><img border="0" name="banner3" id="banner3" src="../img/banner3.jpg"></a>
</div></div>
</body>
</html>