Código HTML:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript" charset="utf-8"></script> <div class="slideshow"> <img src="http://marcelca.net46.net/18fotos/h01.jpg"/> <img src="http://marcelca.net46.net/18fotos/h02.jpg"/> <img src="http://marcelca.net46.net/18fotos/h03.jpg"/> <img src="http://marcelca.net46.net/18fotos/h04.jpg"/> <img src="http://marcelca.net46.net/18fotos/h05.jpg"/> </div> <script type="text/javascript"> $(function(){ (function(){ var imgs=$('.slideshow img'); var l=imgs.length-1, M=Math, i=M.floor((M.random()*(l+1))), current=i; function shuffle() { $(imgs[i]).fadeIn(2500, function(){ i=M.floor((M.random()*(l+1))); i=(current==i)?((i+1)>l?(i-1):(i+1)):i; current=i; setTimeout(function(){ $('.slideshow img').fadeOut(2500); shuffle(); }, 5000); }); } shuffle(); })(); }); </script>