You must Sign In to post a response.
Category: .NET
#583227
<BODY onLoad="runSlideShow()">
<div id="FloatSlideShow" style="position:absolute;z-index:1000000">
<a href="http://www.codebrain.com" target=_new>
<img border=0 src="float1_trans.gif" name='SlideShow' width=200 height=200></a>
</div>
<script>
var slideShowSpeed = 3000
// Duration of crossfade (seconds) for IE:
var crossFadeDuration = 3
var whereX = 140;
var whereY = -233;
var Pic = new Array() // don't touch this!
Pic[0] = 'float1_trans.gif'
Pic[1] = 'float2_trans.gif'
Pic[2] = 'float3_trans.gif'
Pic[3] = 'float4_trans.gif'
Pic[4] = 'float5_trans.gif'
var nn=(navigator.appName.indexOf("Netscape")!=-1);
var t;var j=0;var p=Pic.length;var preLoad=new Array();
for (i=0;i<p;i++){preLoad[i]=new Image();preLoad[i].src = Pic[i];}
function runSlideShow(){
if (document.all){
document.images.SlideShow.style.filter="blendTrans(duration=2)";
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
document.images.SlideShow.filters.blendTrans.Apply();}
if (document.all || document.getElementById){document.images.SlideShow.src = preLoad[j].src;}else{
document.FloatSlideShow.document.images["SlideShow"].src = preLoad[j].src;}
if (document.all){document.images.SlideShow.filters.blendTrans.Play();}
j=j+1;if (j>(p-1))j=0;t=setTimeout('runSlideShow()', slideShowSpeed);}
var dD=document,dH=dD.html,dB=dD.body,px=dD.layers?'':'px';
function floatSS(iX,iY,id){
var L=dD.getElementById?dD.getElementById(id):dD.all?dD.all[id]:dD.layers[id];
this[id+'O']=L;if(dD.layers)L.style=L;L.nX=L.iX=iX;L.nY=L.iY=iY;
L.P=function(x,y){this.style.left=x+px;this.style.top=y+px;};L.Fss=function(){var pX, pY;
pX=(this.iX >=0)?0:nn?innerWidth:nn&&dH.clientWidth?dH.clientWidth:dB.clientWidth;
pY=nn?pageYOffset:nn&&dH.scrollTop?dH.scrollTop:dB.scrollTop;
if(this.iY<0)pY+=nn?innerHeight:nn&&dH.clientHeight?dH.clientHeight:dB.clientHeight;
this.nX+=.1*(pX+this.iX-this.nX);this.nY+=.1*(pY+this.iY-this.nY);this.P(this.nX,this.nY);
setTimeout(this.id+'O.Fss()',33);};return L;}
floatSS(whereX,whereY,'FloatSlideShow').Fss();
</script>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
<div id="FloatSlideShow" style="position:absolute;z-index:1000000">
<a href="http://www.codebrain.com" target=_new>
<img border=0 src="float1_trans.gif" name='SlideShow' width=200 height=200></a>
</div>
<script>
var slideShowSpeed = 3000
// Duration of crossfade (seconds) for IE:
var crossFadeDuration = 3
var whereX = 140;
var whereY = -233;
var Pic = new Array() // don't touch this!
Pic[0] = 'float1_trans.gif'
Pic[1] = 'float2_trans.gif'
Pic[2] = 'float3_trans.gif'
Pic[3] = 'float4_trans.gif'
Pic[4] = 'float5_trans.gif'
var nn=(navigator.appName.indexOf("Netscape")!=-1);
var t;var j=0;var p=Pic.length;var preLoad=new Array();
for (i=0;i<p;i++){preLoad[i]=new Image();preLoad[i].src = Pic[i];}
function runSlideShow(){
if (document.all){
document.images.SlideShow.style.filter="blendTrans(duration=2)";
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
document.images.SlideShow.filters.blendTrans.Apply();}
if (document.all || document.getElementById){document.images.SlideShow.src = preLoad[j].src;}else{
document.FloatSlideShow.document.images["SlideShow"].src = preLoad[j].src;}
if (document.all){document.images.SlideShow.filters.blendTrans.Play();}
j=j+1;if (j>(p-1))j=0;t=setTimeout('runSlideShow()', slideShowSpeed);}
var dD=document,dH=dD.html,dB=dD.body,px=dD.layers?'':'px';
function floatSS(iX,iY,id){
var L=dD.getElementById?dD.getElementById(id):dD.all?dD.all[id]:dD.layers[id];
this[id+'O']=L;if(dD.layers)L.style=L;L.nX=L.iX=iX;L.nY=L.iY=iY;
L.P=function(x,y){this.style.left=x+px;this.style.top=y+px;};L.Fss=function(){var pX, pY;
pX=(this.iX >=0)?0:nn?innerWidth:nn&&dH.clientWidth?dH.clientWidth:dB.clientWidth;
pY=nn?pageYOffset:nn&&dH.scrollTop?dH.scrollTop:dB.scrollTop;
if(this.iY<0)pY+=nn?innerHeight:nn&&dH.clientHeight?dH.clientHeight:dB.clientHeight;
this.nX+=.1*(pX+this.iX-this.nX);this.nY+=.1*(pY+this.iY-this.nY);this.P(this.nX,this.nY);
setTimeout(this.id+'O.Fss()',33);};return L;}
floatSS(whereX,whereY,'FloatSlideShow').Fss();
</script>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
#583234
GO for a Ad rotator control, create a XML file including the path and name of the images, use this file as a source and bind it to the Ad rotator so that you can display rotating image.
Thanks & Regards
Anil Kumar Pandey
Microsoft MVP, DNS MVM
Thanks & Regards
Anil Kumar Pandey
Microsoft MVP, DNS MVM
#583245
Use Adrotator Control best to way to change image with timer control check this
XMl (ads.XML)
Page Coding Client Side
Regards
N.Ravindran
Your Hard work never fails
XMl (ads.XML)
<?xml version="1.0" encoding="utf-8" ?>
<Advertisements>
<Ad>
<ImageUrl>~/images/sample.jpg</ImageUrl>
<NavigateUrl>http://www.google.com</NavigateUrl>
<AlternateText>This is Sample image</AlternateText>
<Impressions>40</Impressions>
<Keyword>small</Keyword>
<width>500</width>
<Height>300</Height>
</Ad>
<Ad>
<ImageUrl>~/images/sample1.jpg</ImageUrl>
<NavigateUrl>http://www.yahoo.com</NavigateUrl>
<AlternateText>This is Sample image</AlternateText>
<Impressions>40</Impressions>
<Keyword>small</Keyword>
<width>500</width>
<Height>300</Height>
</Ad>
</Advertisements>
Page Coding Client Side
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Timer.aspx.vb" Inherits="Timer" %>
<!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 runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Timer ID="Timer1" Interval="2000" runat="Server">
</asp:Timer>
<asp:UpdatePanel ID="up1" runat="Server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" Eventname="Tick" />
</Triggers>
<ContentTemplate>
<asp:AdRotator ID="AdRotator1" AdvertisementFile="~/ads.xml" keywordFilter="small" runat="Server"/>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
Regards
N.Ravindran
Your Hard work never fails
#583261
Please check the following code:
Thanks & Regards
Paritosh Mohapatra
Microsoft MVP (ASP.Net/IIS)
DotNetSpider MVM
<div>
<asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<asp:AlwaysVisibleControlExtender ID="AlwaysVisibleControlExtender1" runat="server" TargetControlID="Panel1">
</asp:AlwaysVisibleControlExtender>
<asp:Panel ID="Panel1" runat="server">
<asp:Image ID="Image1" runat="server" ImageUrl="sunset.jpg" Height="50px" Width="50px"/>
</asp:Panel>
</div>
Thanks & Regards
Paritosh Mohapatra
Microsoft MVP (ASP.Net/IIS)
DotNetSpider MVM
#583281
or you can use marquee for rotating images in web pages try that
hope this will help you
hope this will help you
Return to Return to Discussion Forum