Click here to Skip to main content
15,914,014 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to add image slidershow in my project .simple slider.so how to add.so give me sugesstion.
Posted

Hi...
Can u see this links!.
http://zurb.com/playground/orbit-jquery-image-slider[^]
http://hscripts.com/scripts/JavaScript/slide-show-image.php[^]

XML
<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>



XML
<div align="center">
        <b> Slide Show using JQuery</b>  <br /> <br /> <br />
        <img src="Images/spring_nature.jpg" alt="Slideshow Image Script" title="Slideshow Image Script" name="slide" border="0" width="250" height="200" />
        <script type="text/javascript">
            slideshowimages("Images/spring_nature.jpg", "Images/sugarbeet.jpg", "Images/templatemo_mai.jpg")
            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 -->
    </div>


Thank u.
 
Share this answer
 
v2
Comments
Member 10279329 20-Feb-14 1:05am    
i want next,privious and bottom of slider icon for click multiple image.thanks.
[no name] 20-Feb-14 1:33am    
See this one for using(ajax) previous, play and next buttons,
http://www.aspdotnet-suresh.com/2011/03/ajax-slideshowextender-control-sample.html
Home.aspx
C#
<table width="679" border="0" align="center" cellpadding="0" cellspacing="0">
                      <tr>
                        <td>
						<div>
                                <table border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                <td>
                                <asp:Image ID="imgslides" runat="server"  width="679" height="205"/> 
                                </td>
                                </tr>
                                </table>
                                <ajax:SlideShowExtender runat="server" AutoPlay="true" ImageTitleLabelID="lblTitle" ImageDescriptionLabelID="lblimgdesc" Loop="true"
                                 
                                TargetControlID="imgslides" SlideShowServicePath="SlideshowH.asmx" SlideShowServiceMethod="GetSlides"></ajax:SlideShowExtender> 
                                </div>
						</td>
                      </tr>                     
                    </table>




SlideshowH.asmx
C#
<%@ WebService Language="C#" CodeBehind="~/App_Code/SlideshowH.cs" Class="SlideshowH" %>



SlideshowH.cs
C#
using System;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;

/// <summary>
/// Summary description for Slideshow
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
[System.Web.Script.Services.ScriptService]

public class SlideshowH : System.Web.Services.WebService {

public SlideshowH () {

//Uncomment the following line if using designed components 
//InitializeComponent(); 
}

[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public AjaxControlToolkit.Slide[] GetSlides()
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["shoppe"].ConnectionString);
SqlCommand cmd = new SqlCommand();
SqlDataAdapter adap = new SqlDataAdapter();
DataSet ds;
cmd = new SqlCommand("select substring(image,4,1000)as image from tbl_panner where page='Home'", con);

adap = new SqlDataAdapter(cmd);
ds = new DataSet();
adap.Fill(ds);

string[] imagenames = System.IO.Directory.GetFiles(Server.MapPath("~/Upload"));
    
//AjaxControlToolkit.Slide[] photos = new AjaxControlToolkit.Slide[imagenames.Length];
AjaxControlToolkit.Slide[] photos = new AjaxControlToolkit.Slide[ds.Tables[0].Rows.Count];

for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
string[] file = imagenames[i].Split('\\');

//photos[i] = new AjaxControlToolkit.Slide("Images/" + file[file.Length - 1], file[file.Length - 1], "");

photos[i] = new AjaxControlToolkit.Slide(ds.Tables[0].Rows[i]["image"].ToString(),"", "");

}
return photos;
}
}
 
Share this answer
 
v2
 
Share this answer
 
Have a look at the following collection which can fulfill your need.

JQUERY Plugins

&

JQUERY LightBox.

Hope it will help you... :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900