Tuesday, 14 August 2012

SharePoint SlideShow Using Java script



using this  code in master Page at where you want

 <a href="javascript:gotoshow()">
        <img src="images/1.jpg"" name="slide" border="0" width="300" height="375"></a>

      <script type="text/javascript">
        slideshowimages("images/1.jpg", "images/2.jpg", "images/3.jpg");
        slideshowlinks("#", "#", "#");

        //configure the speed of the slideshow, in miliseconds
        var Sspeed = 2000

        var Currentimage = 0
        var whichimage = 0
        function slideit() {
            if (!document.images)
                return
            document.images.slide.src = Simage[whichimage].src
            Currentimage = whichimage
            if (whichimage < Simage.length - 1)
                whichimage++
            else
                whichimage = 0
            setTimeout("slideit()", Sspeed)
        }
        slideit()
    </script>


After that Add this script to inside the Head tag in SharePoint Master Page.


    <script type="text/javascript">


var Simage=new Array()

var Slink=new Array()

function slideshowimages(){

for (i=0;i<slideshowimages.arguments.length;i++){

Simage[i]=new Image()

Simage[i].src=slideshowimages.arguments[i]

}

}




function slideshowlinks(){

for (i=0;i<slideshowlinks.arguments.length;i++)

Slink[i]=slideshowlinks.arguments[i]

}




function gotoshow(){

if (!window.winslide||winslide.closed)

winslide=window.open(Slink[Currentimage])

else

winslide.location=Slink[Currentimage]

winslide.focus()

}    </script>



That's it... it working all browser.


No comments:

Post a Comment

KendoUI Chart using in AngularJS with Dynamic data

Here i'm going to do the KendoUI Chart using AngularJS  and getting dynamic data from angular services. First need to down-lode the r...