Friday, 26 May 2017

javascript scroll img

Slide Show

Slideshow
  





<html>
<head>
<script type="text/javascript">
var myPix = new Array("https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTuwZ80gMP3G5Y0C2uo2cxkp8dqBcmJTcbZ5TO5AD9VDzgDplx6D3XlMKGtXsRXHdg2pNJASvoePjKboXspP-qnQrmYvKJFWXQIITzRlYEFXe5WFrJWSFTY7auQKWZfK95oXYUWoNVxDI/s1600/img1.jpg",
"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9uYPaXsQFSXAicSyFDn0HgT5qEgwEXtX3NWQ52xDn4a60_MJ0yeqS1f9QMCoPNdV0ArFh2J8dbjUhiIoxuhfQo4IhgBMROwJTpGSdOjzCX-F6XDHKdQyImSQ7fsLmQBOCEbzkFNGIVu8/s1600/img2.jpg",
"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiibsEDH38Eg54AeZvUzkGxm41tsAASuhzRS6MBnLsGizaNGqEFqV5m2f4S4DxJ1vURvwITX7cv2v8lviYvv5Bwo9Bi3jPto4DFwD51KHwIARnyBWjqqHsIkZqUTSL879Q_FXkkk62YsbE/s1600/img3.jpg",
"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJpCMJ6uwYazpLt2f9Fyn_a6fr9bRswAlfeTmYT8N8ToAVsXGhk2IMJtMEve8lDrCSvxdoGzG1gGyg5P7vSsfHPqk5kMDDKf_jMbsYL4xO5XDnAaQ1l747T5fZeAmWhpr2m9tylp7iVvQ/s1600/img4.jpg",
"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdgYCSipUcWpgjzeAphx2p-eHO1pY-ajYtXhFbmUJuhTeMwZtqKNvAj6__V2aAzJ5OJAcb6KyTVyRfFZReSbYllSKyQOVRdWDdvaJEsPlfIrKeJfTCEaVdUqOVppOWTYSjq3ZXBcgxzkw/s1600/img5.jpg");

var pic_index = 0;

function processPrevious() {
 if (pic_index == 0) {
  pic_index = myPix.length;
 }
 pic_index--;
 document.getElementById("myPicture").src = myPix[pic_index];
 return false;
}

function processNext() {
 pic_index++;
 if (pic_index == myPix.length) {
  pic_index = 0;
 }
 document.getElementById("myPicture").src = myPix[pic_index];
 return false;
}

</script>

<style>
#myPicture{height:300px;}
</style>

</head>
<body>
<div align="center">
  <h1> Slide Show</h1>
  <img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTuwZ80gMP3G5Y0C2uo2cxkp8dqBcmJTcbZ5TO5AD9VDzgDplx6D3XlMKGtXsRXHdg2pNJASvoePjKboXspP-qnQrmYvKJFWXQIITzRlYEFXe5WFrJWSFTY7auQKWZfK95oXYUWoNVxDI/s1600/img1.jpg" id="myPicture" alt="Slideshow" />
  <br/>
  <input type="button" class="button" onclick="processPrevious()" value="&lt;&lt; Previous"/>
&nbsp;&nbsp;
  <input type="button" class="button" onclick="processNext()" value="Next &gt;&gt;"/>
 </div>
</body>
</html>

No comments:

Post a Comment