-
Hi, can any one show me with code how I may be able to scroll an image across the page continuously.
I've seen it on a website and wish to do something similar for a site I'm doing for a friend.
Her is were I saw it:
http://www.kenneallycreative.com/
:) THANKS IN ADVANCE :)
-
It uses JavaScript and DHTML to scroll it along. Just right click on the image and choose "View Source".
-
Yeh I kind of already did that, the problem is that as I'm new to JavaScropt and that, I need to know which code belongs to scrolling the image and which is for other bit's. Can some just show me the part which does the scrolling so that I may be able to apply it to my own image.
:) THANKS IN ADVANCE :)
-
this is the function which makes the image scroll:
Code:
function tick() {
if (ver ==3) return
if (ns){
document.first.offset(-pix,0);
document.second.offset(-pix,0);
if (document.first.left <= again) document.first.left = ImgWidth;
if (document.second.left <= again) document.second.left = ImgWidth;
}
else {
newpix = document.all["first"].style.pixelLeft - pix;
newpix2 = document.all["second"].style.pixelLeft - pix;
document.all["first"].style.pixelLeft = newpix;
document.all["second"].style.pixelLeft = newpix2;
if (document.all["first"].style.pixelLeft <= again) document.all["first"].style.pixelLeft = ImgWidth;
if (document.all["second"].style.pixelLeft <= again) document.all["second"].style.pixelLeft = ImgWidth;
}
setTimeout('tick()', time);
}