Click to See Complete Forum and Search --> : Image rotating code
Gordy
01-04-2004, 09:00 PM
Im looking for a image rotating code for my forum, I had it once but losted due to a computter crash, can any one help thanks. Gordy
P:S When I mean rotating I mean diferent image in the front page rotating. Thanks so much and Happy New Year.
fredmv
01-04-2004, 09:19 PM
Welcome to the forums.
Do you mean an image that keeps changing at certain intervals, or an image that keeps changing everytime you reload the page?
Gordy
01-05-2004, 05:16 AM
changing at certain intervals
clairec666
01-05-2004, 07:19 AM
Not sure if you're still there...........
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
if (document.images)
{
prel = new Image();
prel.src = ".gif";
}
function switchit(obj,img){
if (document.images)
{
obj.src=img
}
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
var slideShowSpeed = 5000;
var fadeimgarray = new Array();
var imgloaded = new Array(fadeimgarray.length);
for (i=0; i<imgloaded.length; i++) {
imgloaded[i] = false
}
var j = 0;
var preload = new Array();
preload[0] = new Image();
preload[0].src = fadeimgarray[0];
imgloaded[0] = true;
function runSlideShow(){
k = Math.floor(Math.random()*fadeimgarray.length);
(j != k) ? m = k : m = k+1;
if (m > (fadeimgarray.length - 1)) m = 0;
document.images.SlideShow.style.filter="blendTrans()";
document.images.SlideShow.filters.blendTrans.Apply();
document.images.SlideShow.src = preload[j].src;
document.images.SlideShow.filters.blendTrans.Play();
j = m;
if (imgloaded[j] == false) {
preload[j] = new Image();
preload[j].src = fadeimgarray[j];
imgloaded[j] = true
}
setTimeout('runSlideShow()', slideShowSpeed);
}
</SCRIPT>
<BODY onLoad="setTimeout('runSlideShow()',5000)">
<CENTER>
<IMG SRC="" NAME="SlideShow" HEIGHT=500 WIDTH=800 BORDER=0></a></CENTER>
</BODY>
</HTML>
Insert the file names of your image into the fadeimgarray.
Gordy
01-06-2004, 12:37 AM
Good Evening clairec666 I would like to thank you so much for that code I do have one question where do I put my HTTP address at , where do I insert it at. Thanks again for all your troubles and Happy New year . Gordy
Here is a HTTP Adress.
http://images.snapfish.com/339659%3A%3B23232%7Ffp54%3Dot%3E232%3B%3D364%3D74%3C%3DXROQDF%3E232348%3A5%3B689%3Aot1lsi
http://images.snapfish.com/339659%3A%3B23232%7Ffp54%3Dot%3E232%3B%3D364%3D74%3C%3DXROQDF%3E232348%3A5%3B6%3A%3A7ot1lsi