how can i use setInterval()
to make a slideshow of images with the code i have now that only has thumbnails that display in one big div(larger pic of the thumbnail) when the thumbnail gets hovered over.(onmouseover)

this is the javascript function.: how can iuse set interval to make the images display every 5 seconds(in order)(change display)? javascript code::

function OnMouseOverMainImage(image, mainImage)
mainImage.src = image.src;
jsLastMainImage = image.src;

<span id="thumb">
<img src="small1.png" width="10" height="10" style="border: 0px;" onMouseOver="OnMouseOverMainImage(this,ctrl);changeme('box', 'show');" onclick="changeme('thumb', 'hide');"> <img src="image2.png" width="10" height="10" style="border:0px;" onmouseover="OnMouseOverMainImage(this,ctrl);changeme('box', 'show');" onclick="changeme('thumb', 'hide');"></span>
<div id="box" style="width:auto; height:auto;text-align:center">
<img id="ctrl" onclick="changeme('box', 'hide');" onmouseover="OnMainImageCtrlMouseOver(this,1)" onmouseout="OnMainImageCtrlOnMouseOut(this)" onmousemove="OnMainImageCtrlOnMouseMove(this,event)" src="noimage.png" style="border: 0px;"> 
7 Years
Discussion Span
Last Post by SKANK!!!!!


I would also not use setInterval (I have never used it). Instead, create a supervisor function containing a conditional setTimeout which calls the supervisor iteratively. The condition will allow one or more events to terminate what is otherwise an endless iteration. Restart by resetting flag(s) etc. as necessary, then call the supervisor again.

This is a common pattern and a good one to learn.

Slide show is a very common piece of functionality. Personally, I would seek a ready-developed script and adapt it as necessary.



That's strange because you don't hold back from asking experts on Daniweb to write your scripts for you whenever you get into trouble!


This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.