views:

30

answers:

4

Hello,

I don't know exactly how it's called (Image-timer??? I'm not sure), but here are the functionalities.

Let's say I have a div where I need to display a group of images in loop, one at time (each 5 seconds, for instance). On top of that, I'd like some effects, such as fading out when an image replace an other.

Can someone point me to a Jquery widget that does that or tell me if I can get that using JQuery?

Thanks for helping

+2  A: 

It sounds like you want to use the setInterval function: http://www.w3schools.com/jsref/met_win_setinterval.asp

<html>
<body>

<input type="text" id="clock" />
<script language=javascript>
var int=self.setInterval("clock()",1000);
function clock()
  {
  var d=new Date();
  var t=d.toLocaleTimeString();
  document.getElementById("clock").value=t;
  }
</script>
</form>
<button onclick="int=window.clearInterval(int)">Stop</button>

</body>
</html>

Based on that you can change the image's src and do fading effects every X seconds.

marcgg
(+1) I like this method best - Since you get more control over what your function does and the overhead it incurres.
Byron Cobb
thanks. imho it's better to avoid using plugins when the feature needed is so simple
marcgg
+1  A: 

you are looking for a slideshow plugin. I use this one it has everything you asked for JQuery Cycle Plugin

Tristan
+2  A: 

Try s3Slider - http://www.serie3.info/s3slider/demonstration.html. It is a really slick jQuery plugin that will do exactly what you're asking.

Alison
+1  A: 

You might want to check this out : jQuery Cycle Plugin

It can give you more than a dozen of effects, allows you to specify the timeout and animation speed.

xar