Wednesday, October 24, 2012

Easy jQuery Slideshow

Introduction

Hi all,
This is simple use for slideshow , We have 3 step for this.

Step 1: Add the JavaScript function

Copy and paste script below in your script tag.

var folder = "images";
var timeout = 4000;
var StartPicc = 2;
var EndPicc = 5;
var timer;
$(document).ready(function () {
    timer = setTimeout("EasySlideShow();", timeout);
});
function EasySlideShow() {
    $("#imgshow").fadeOut('slow', function () {
        $("#imgshow").attr("src", folder + "/" + StartPicc.toString() + ".jpg");
        $("#imgshow").fadeIn('slow')
        if (StartPicc < EndPicc)
            StartPicc++;
        else
            StartPicc = 1;
    });
    clearTimeout(timer);
    timer = setTimeout("EasySlideShow();", timeout);
}

Step 2: Add jQuery

Step 3: Add image to your folder
named folder to images
named picture to 1.jpg > xxx.jpg

Copy and paste script below in your script tag.


Enjoy Easy ASP.NET jQuery Demo ZomDev

No comments:

Post a Comment