Mara: Slideshow

Beitrag lesen

<script type="text/javascript">  
        function fade(step) {  
            var imgs = document.getElementById("meinFader").getElementsByTagName("img");  
  
            step = step || 0;  
  
            imgs[counter].style.opacity = step/100;  
            imgs[counter].style.filter = "alpha(opacity=" + step + ")"; //  
  
            step = step + 2;  
  
            if (step <= 100) {  
                window.setTimeout(function () { fade(step); }, 1);  
            } else {  
                window.setTimeout(next, 2000);  
            }  
        }  
  
        function next() {  
            var imgs = document.getElementById("meinFader").getElementsByTagName("img");  
  
            if (typeof(counter) != "number") {  
                counter = 0;  
            }  
  
            counter++;  
  
            if (counter < imgs.length) {  
                fade();  
              }  
		  
	if (counter==imgs.length)  
                         {  
                                counter=0;  
                                fade();  
                        }  
  
  
		  
  
        };  
    </script>  
    <style type="text/css">  
        .next { position: absolute; top: 0; left: 0; opacity: 0; filter:alpha(opacity=0); }  
        #meinFader { position: relative; }  
    </style>  
</head><body onLoad="javascript:next()">  
  
    <p id="meinFader">  
        <img src="images/1.jpg" width="368" height="250"alt="">  
        <img src="images/2.jpg" width="368" height="250" alt="" class="next">  
        <img src="images/3.jpg" width="368" height="250" alt="" class="next">  

wer weiß dann was hier geändert werden muss dass eine endlos wiedergabe erfolgt?