Adding Image Slideshow on any HTML Webpage / blogger site

A number of web developers face challenge in adding a simple image slideshow in a HTML webpage. There are very tough codes available on net for this task. But most of them demand images to be of same size, or the code is too tough to implement due to usage of css and advanced java script. Here we are proving a simple HTML code with minimal usage of Java script. You can directly use in it your blog post's HTML coding.


Here is the code

<script type="text/javascript">
var x=0;
function rotate(num){
fs=document.ff.slide;
x=num%fs.length;
if(x<0) x=fs.length-1;
document.images.show.src=fs.options[x].value;
fs.selectedIndex=x;}
function auto() {
if(document.ff.fa.value == "Stop"){
rotate(++x);setTimeout("auto()", 2000);}}
</script>
<form name="ff">
<table cellpadding=3 style="border:1px solid;border-collapse:collapse; border-color:#C0C0C0">
<tr><th align=center>Tourist Places in India</th>
</tr><tr><td align=center>
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipyh8qu9vAGWXYR_63819MmhyPpG0KiTdZpPfbVM5jCgQ_eBjUDMHVNOUEm8MsCnDa60PyuGetgJNAIVXQyCv31d8vjLxNfrLEzuZc76NdkA52CHb_Lh9w6icBjhtnXV1i0vlDo2_026k/s1600/shimla-manali.jpg" name="show">
</td></tr><tr>
<td align=center style="border:1px solid; border-color:#C0C0C0">
<input type="button" onclick="rotate(0);" value="ll<<" title="Jump to Start" />
<input type="button" onclick="rotate(x-1);" value="Previous " title="Previous photo" style="width:80px;" />
<input type="button" name="fa" onClick="this.value=((this.value=='Stop')?'Start':'Stop');auto();" value="Start Slidshow" title="Auto-play" style="width:150px;" />
<input type="button" onclick="rotate(x+1);" value="Next" title="Next Photo" style="width:80px;" />
<input type="button" onclick="rotate(this.form.slide.length-1);" value=">>ll" title="Jump to end" />
</td></tr><tr>
<td align=center style="border:1px solid; border-color:#C0C0C0">
<select name="slide" onChange="rotate(this.selectedIndex);">
<option value="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipyh8qu9vAGWXYR_63819MmhyPpG0KiTdZpPfbVM5jCgQ_eBjUDMHVNOUEm8MsCnDa60PyuGetgJNAIVXQyCv31d8vjLxNfrLEzuZc76NdkA52CHb_Lh9w6icBjhtnXV1i0vlDo2_026k/s1600/shimla-manali.jpg">Shimla-Manali </option>
<option value="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhz-AA6fDdHwT0U-UF1Aj_b7h60Ai4hIeB2uicz0EhrzTvcW2R5Iao1WFOgyp2RlfcHMmfuPmLz4oMBa6TbgLu33TaGWihO7GnPjB3tIBMjiTJbN6Ir7K0TP9eiBbAW5OzSWzs4s3ynPSM/s1600/darjeeling.JPG">Darjeeling</option>
<option value="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAFA0E8SUYgzAVX2qgldCNs-IVugeedjGJw42z1rIs87hP5oE5hbzIqjcSDtcmtEBByKF_gsRh1eSAPH61NTuiKiwEki8JZQTKIlwsIYH4Po93j5EzOL9xGaERcoTPkWv9C8RXIEv4vz4/s1600/corbett+national+park.jpg">Corbett National Park 
</option>
<option value="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5D0TG52JhyphenhyphenCgQKmHKIJ2ZRSMzs03-OYY_VQMjIZ1jkRFOuQqNPypCJ1cH6XXm6EZx8xJYlYryl3bMqk54SADIYvqoKf6HG_xcXQMdW_JvuJSzrwh3YnsrP6OCDG8ZIvvA_gpvVIavNqw/s1600/Lashmir.jpg">Kashmir </option>
<option value="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhg2ZNTNdOEN3eOyjO2bfFazkIjwA5x7yH7_5ztffbLZS5tS8XtJxCMa827PWshknlqUTlQLd_G_MaYguJAQo5KPg1VkBslzee7axrH24hybajs4o52A5RrdFZL49R6mmPRcrgacFrm9zQ/s1600/andaman.jpg">Andman </option>
<option value="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKeiqkVKQX-ic6qEl3YrFkCjydTQHQwtVO7aFpDFkmysHGG8ZJklGoDH7SH1O8fBNfE0JI3xbx1CbiWIGL83PoYxNfM23Yxmj4W6sC2FBfUZdS98nyilIt9Tok_vMkpdysWpgafN39nd8/s1600/kerala.jpg">Kerala </option>
<option value="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBIO8M8ms21c8ZmFYxUf57RsPOdlGkm8GK2YxZBV-dpEVtj6lZVOXwsh75smXIHZPlqXw3PTn_eN2CDy05PGvL5YpbKGf6wmz_Xxm39uZ2U2aiXd5_CihsRqt2Y9ox0l799aVqg71L0CQ/s1600/Tajmahal.jpg">Tajmahal </option>
<option value="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqRRLIizVA1MfFD_J_lHFtUKOavxpwA8GtdC9UgO0bxHnDkyId80nU2H5g_IfzPvU932Eu7bCLQCc0lCqoFzvQ5q-xO3R62ldHCkB3Dw0n5wFJjxeaQ0V6xg1PJ7FCIr600CSRc7VVx4Y/s1600/Goa.jpg">Goa </option>
<option value="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi38NIN4S-Lf7cqtd1mKkb3TrMEO_P753GtMbuM2R9od-Ii1MeZVmZlfWsIqP98VxAQKE4VcIvkY9xwj68KLAJd1DmE2pCO72B2utbHjVJWZy7dsXh2tyMTu5Jn6VpKBVobDyWvUZ2buAc/s1600/Laddakh.jpg">Ladakh </option>
</select>
</td></tr></table>

 The implementation of the above code will provide the following result


Tourist Places in India

If you are smart enough to be a web developer, then you know how to change the code implement it on your website. You can add or delete images by adding or deleting the <option ></option> tag which is in the end part of the code.
Share this Article :
Email

No comments:

Post a Comment