Play Games

Search This Blog

Wednesday, August 27, 2014

SlideShow in Visualforce Page

<apex:page >
<html>
<script type="text/javascript">
var slideimages=new Array()
function slideshowimages()
{

     for (i=0;i<slideshowimages.arguments.length;i++){
         slideimages[i]=new Image()
         slideimages[i].src=slideshowimages.arguments[i]
    }
}
</script>

<img src="{!$Resource.image2}" alt="Slideshow Image Script" title="Slideshow Image Script" name="slide" border="0" width="200" height="200"/><a href="http://hscripts.com" style="text-decoration:none;cursor:pointer;font-size:12px;color:green;">H</a>
<script type="text/javascript">
slideshowimages("{!$Resource.image2}","{!$Resource.image1}")
var slideshowspeed=2000
var whichimage=0
function slideit()
{
     if (!document.images)
           return
     document.images.slide.src=slideimages[whichimage].src
     if (whichimage<slideimages.length-1)
              whichimage++
     else
              whichimage=0
      setTimeout("slideit()",slideshowspeed)
}
 slideit()
</script>
<!-- Script by hscripts.com -->
</html>
</apex:page>
Note: Replace image urls.


No comments:

Post a Comment