Hello everybody.
I've this problem: I'm making a jpg moving horizontally from left to right in my page. I'd like to make it start moving from the left off-screen side. I tried using position negative values either defining the <style> of the img object or in the Javascript function that produces the image movement, but it doesn't work. The starting point from the images is always on screen.
Anybody can turn on the light??
Thanks!
This is the Js File:
[CODE=javascript]var timer1;
function iecompattest(){
return (document.compa tMode && document.compat Mode!="BackComp at")? document.docume ntElement : document.body
}
function Chip(chipname,w idth,height){
this.named=chip name;
this.xx=(-495);
this.yy=208;
this.timer1=nul l;
}
function movechip(chipna me){
if (document.getEl ementById){
eval("chip="+ch ipname);
if (window.innerWi dth || window.opera){
pageY=window.pa geYOffset;
pageH=window.in nerHeight;
}
else if (document.body) {
pageY=iecompatt est().scrollTop ;
pageH=iecompatt est().offsetHei ght;
}
while(chip.xx<2 50){
chip.xx=chip.xx +5;}
if (chip.xx<=420)
{
chip.xx=chip.xx +5;
}
else
chip.xx=chip.xx ;
document.getEle mentById(chip.n amed).style.lef t=chip.xx+"px";
chip.timer1=set Timeout("movech ip('"+chip.name d+"')",50);
}[/CODE]
I've this problem: I'm making a jpg moving horizontally from left to right in my page. I'd like to make it start moving from the left off-screen side. I tried using position negative values either defining the <style> of the img object or in the Javascript function that produces the image movement, but it doesn't work. The starting point from the images is always on screen.
Anybody can turn on the light??
Thanks!
This is the Js File:
[CODE=javascript]var timer1;
function iecompattest(){
return (document.compa tMode && document.compat Mode!="BackComp at")? document.docume ntElement : document.body
}
function Chip(chipname,w idth,height){
this.named=chip name;
this.xx=(-495);
this.yy=208;
this.timer1=nul l;
}
function movechip(chipna me){
if (document.getEl ementById){
eval("chip="+ch ipname);
if (window.innerWi dth || window.opera){
pageY=window.pa geYOffset;
pageH=window.in nerHeight;
}
else if (document.body) {
pageY=iecompatt est().scrollTop ;
pageH=iecompatt est().offsetHei ght;
}
while(chip.xx<2 50){
chip.xx=chip.xx +5;}
if (chip.xx<=420)
{
chip.xx=chip.xx +5;
}
else
chip.xx=chip.xx ;
document.getEle mentById(chip.n amed).style.lef t=chip.xx+"px";
chip.timer1=set Timeout("movech ip('"+chip.name d+"')",50);
}[/CODE]
Comment