Mecha versi 2.6.4 sudah dirilis!

Auto Rotating Slideshow

Tabel Konten
  1. Demo 
<style>
#slideshow {
  width:200px;
  height:100px;
  background-color:#222;
  margin:0 auto;
}

#slideshow img {display:block;}
</style>
<div id="slideshow"></div>
<script>
//<![CDATA[
(function() {
    var container = document.getElementById('slideshow');
    var slide = [
        "images/slide-1.jpg",
        "images/slide-2.jpg",
        "images/slide-3.jpg",
        "images/slide-4.jpg"
        // dst...
        ];
    var count = 0;
    setInterval(function() {
        container.innerHTML = "<img src='"+slide[count]+"' alt='Slide "+(count+1)+"'>";
        count++;
        if (count == slide.length) {
            count = 0;
        }
    }, 3000); // Tiga detik sekali...
})();
//]]>
</script>

Demo 

4 Komentar

abang ichal

di moz 13 yg sy pakai. ga ada rotatingnya.
atau itu hanya berlaku webkit ya?

Komentar telah ditutup.