Thursday, November 22, 2012

How use Image Slider in ASP.NET Using Javascript Funtion

Here I will represent a article in this article we are using a slider which using any header of project that means master page the main important things this slider changes different diffrent color or image as you use in project.Hope this article helpfull for you...............


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="vsoft.aspx.cs" Inherits="GauravKapoor" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<script language="JavaScript1.1">
/*
JavaScript Image slideshow:
By VSoftTechnology (http://www.vsofttechnologies.com/)
*/
var slideimages = new Array()
var slidelinks = new Array()
function slideshowimages() {
for (i = 0; i < slideshowimages.arguments.length; i++) {
slideimages[i] = new Image()
slideimages[i].src = slideshowimages.arguments[i]
}
}
function slideshowlinks() {
for (i = 0; i < slideshowlinks.arguments.length; i++)
slidelinks[i] = slideshowlinks.arguments[i]
}
function gotoshow() {
if (!window.winslide || winslide.closed)
winslide = window.open(slidelinks[whichlink])
else
winslide.location = slidelinks[whichlink]
winslide.focus()
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<a href="javascript:gotoshow()">
<img src="Images/GauravKapoor.jpg" name="slide" border="0" style="width: 600px; height: 333px;
margin-right: 0px;"></a>
<script>

//configure the paths of the images, plus corresponding target links
slideshowimages("Images/GauravKapoor.jpg", "Images/GauravKapoor1.jpg", "Images/GauravKapoor2.jpg", "Images/GauravKapoor3.jpg", "Images/GauravKapoor4.jpg")
slideshowlinks("http://www.vsofttechnologies.com/images/3.jpg", "http://www.vsofttechnologies.com/images/2.jpg", "http://www.vsofttechnologies.com/images/1.jpg", "http://www.vsofttechnologies.com", "http://www.vsofttechnologies.com")
//configure the speed of the slideshow, in miliseconds
var slideshowspeed = 3000
var whichlink = 0
var whichimage = 0
function slideit() {
if (!document.images)
return
document.images.slide.src = slideimages[whichimage].src
whichlink = whichimage
if (whichimage < slideimages.length - 1)
whichimage++
else
whichimage = 0
setTimeout("slideit()", slideshowspeed)
}
slideit()
</script>
</div>
</form>
</body>
</html>