views:

67

answers:

2

How can i fade rotate between two images using jQuery? Say for example.

<img src="image01.jpg" />
<img src="image02.jpg" />

I like the images to fade in/out between for say 2seconds each.

Thanks! Much appreciated. :)

+1  A: 

http://modul22.ru/js/front/about.js - realization of similar effect.

http://modul22.ru/about - page with this effect (rus)

kpower
+1  A: 

A simple example i knocked up.

<div id="imageSwap">
</div>  


 <script language="javascript" type="text/javascript">

    $(document).ready(function () {
      setImageOne();
    });

    function setImageOne() {
      $('#imageSwap').fadeIn(500).html('<img src="image01.jpg" />').delay(2000).fadeOut(500, function () { setImageTwo(); });
    }

    function setImageTwo() {
      $('#imageSwap').fadeIn(500).html('<img src="image02.jpg" />').delay(2000).fadeOut(500, function () { setImageOne(); });
    }

  </script>
GordonB
good knock up, Gordon!
Patrick Karcher