Moving Image through javascript like flash file in asp.net

This asp.net article used for making slide show from JavaScript. Many time we need to do such task like moving images in html pages or an aspx page then we think about flash to do that task but it is must to install flash plugin in client browser,so we need an alternative solution of flash to move image just like flash, so here is the solution for making image slide solution through javascript, Just Add Your Image In Picture Array And Add Fuction to body onload.


<html>
<head>
   <script type="text/javascript">
       // Set the slideshow speed (in milliseconds)
       var SlideShowSpeed = 2000;
       // Set the duration of crossfade (in seconds)
       var CrossFadeDuration = 2;
       var Picture = new Array(); // don't change thishttp://www.assoc-amazon.com/e/ir?t=widgetsamazon-20&l=btl&camp=213689&creative=392969&o=1&a=B003A9FFKI
      //***Add Your Image Here To Make Slide Show)**
      Picture[1] = 'https://lh6.googleusercontent.com/-yxSVExWlgVU/TnGzagza8CI/AAAAAAAAAFo/7J-TtBIAeIk/h80/images2.jpeg';

       Picture[2] = 'https://lh6.googleusercontent.com/-T1gMExXTH0k/TnGzfOuwv7I/AAAAAAAAAFs/avs2xX0HItY/h80/images.jpeg';

       Picture[3] = 'https://lh4.googleusercontent.com/-ddekiHGKZZ4/TnGzfx37seI/AAAAAAAAAFw/Xrfj6llMBFc/h80/images1.jpeg';

       Picture[4] = 'https://lh3.googleusercontent.com/-12l1Dtt1jyI/TnGzgp4DZ9I/AAAAAAAAAF4/I-BPvCGbb5k/h80/images3.jpeg';

       Picture[5] = 'https://lh6.googleusercontent.com/-PDV1Qb0iVY4/TnGzhJxAIOI/AAAAAAAAAF8/XQ6Lv3cmhz4/h80/images4.jpeg';

       Picture[6] = 'https://lh4.googleusercontent.com/-tMJmD_E0E2w/TnGzhvrkbTI/AAAAAAAAAGA/_p3JslMbGLA/h80/index.jpeg';

       Picture[7] = 'https://lh5.googleusercontent.com/-rHjrWPBlsug/TnGziCXDNLI/AAAAAAAAAGE/gfhzeGX5Epc/h80/index1.jpeg';

       var tss;
       var iss;
       var jss = pickRandom(Picture.length - 1);
       var pss = Picture.length - 1;
       //alert(jss);
       var preLoad = new Array();
       for (iss = 1; iss < pss + 1; iss++) {
           preLoad[iss] = new Image();
           preLoad[iss].src = Picture[iss];
       }
       function runSlideShow() {
           if (document.all) {
               document.images.LogoBox.style.filter = "blendTrans(duration=2)";
               document.images.LogoBox.style.filter = "blendTrans(duration=CrossFadeDuration)";
               document.images.LogoBox.filters.blendTrans.Apply();
           }
           document.images.LogoBox.src = preLoad[jss].src;
           //if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
           if (document.all) document.images.LogoBox.filters.blendTrans.Play();
           jss = jss + 1;
           if (jss > (pss)) jss = 1;
           tss = setTimeout('runSlideShow()', SlideShowSpeed);
       }
       function pickRandom(range) {
           if (Math.random)
               return (Math.round(Math.random() * range) + 1);
           else {
               return 1;
           }
       }
   </script>
</head>
<body onload="setTimeout('runSlideShow()', 1001);">
   <!-- Client Name of ImageControl must be 'LogoBox'-->
    <img name="LogoBox" border="0" src="design/space.gif" width="140" >
</body>
</html>


// OutPut of the following code is here:-




Recent Article