|
-
Mar 14th, 2006, 04:50 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] scrolling background
hi,
I am tring to create a simple "scrolling background" but the result was a failure.
can you help me please,,
I have two images each is 999 pix of width ,the idea is when the first image is= to the left edge of the screen
I want the second image to follow the first one and so on...
PHP Code:
<script>
var sstop=setInterval("run()",50)
function run()
{
var pic1 = document.getElementById("imagea");
var pic2 = document.getElementById("imageb");
pic1.style.posLeft-=3;
if(pic1.style.posLeft<0)
{
pic2.style.posLeft=999;
pic2.style.posLeft-=3;
}
else
if(pic2.style.posLeft<0)
{
pic1.style.posLeft=999;
pic1.style.posLeft-=3;
}
}
</script>
<img src="aaa.gif" id=imagea style="position:absolute;left:1;width:999";>
<img src="bbb.gif" id=imageb style="position:absolute;left:999;width:999";>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|