Category Archives: javascript

javascript image cycle

      Yorum yok javascript image cycle

<body> <img id=’img_’ src=’#’ width=’100′ height=’100′ /> <input type=’button’ name=’name’ value=’sonraki resim’ onclick=’next();’ /> <script> var index = -1; var pictures = new Array( ‘Images/0004574.jpg’, ‘Images/0004604.jpg’, ‘Images/0004611.jpg’, ‘Images/0004613.jpg’, ‘Images/0004592.jpg’); window.onload = function () { next(); } function next() { index = (index + 1) % pictures.length; document.getElementById(‘img_’).src = pictures[index]; console.log(index);… Read more »