Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 25th, 2009, 09:48 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Question Getting Slide Show to work

This is my first attemp to work with slide show. I'm not sure what I am doing wrong but here is the code. At page launch no image is being shown and images do not rotate. Thank you.



PHP Code:
<%@MasterLanguage="VB"CodeFile="MasterPage.master.vb"Inherits="MasterPage" %>
<!
DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
htmlxmlns="http://www.w3.org/1999/xhtml">
<
headid="Head1"runat="server">
<
title>Test JavaScript Slide Show</title>
<
scripttype="text/javascript">
var 
image1=new Image()
image1.src="/Images/01.jpg"
var image2=new Image()
image2.src="/Images/02.jpg"
var image3=new Image()
image3.src="/Images/04.jpg"
</script>
</head>
<bodyonload="slideit()">
<imgonload="slideit()"alt="No Image"src="/images/01.jpg"name="slide"width="100"
height="50"/>
<scripttype="text/javascript">
var step=1
function slideit()
{
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src")
if (step<3)
step++
else
step=1
setTimeout("slideit()",2500)
}
</script>
<formid="form1"runat="server">
<div>................... 

Last edited by snufse; February 26th, 2009 at 03:22 PM..
 
Old February 26th, 2009, 05:47 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Smile

Code that will work:

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
htmlxmlns="http://www.w3.org/1999/xhtml">
<
headid="Head1"runat="server">
<title>Test - JavaScript Slide Show</title>
<scripttype="text/javascript">
var
image1=new Image()
image1.src=
"Images/01.jpg"
var image2=new Image()
image2.src=
"Images/02.jpg"
var image3=new Image()
image3.src=
"Images/04.jpg"
</script>
</
head>
<
bodyonload="slideit()">
<imgalt="No Image"src="images/01.jpg"name="slide"width="100"
height="50"/>
<scripttype="text/javascript">
var
step=1
function slideit()
{
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src")
if (step<3)
step++
else
step=1
setTimeout(
"slideit()",2500)
}
</script>
<formid="form1"runat="server">
<div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tableborder="1"style="left: 2px;
width: 1088px; position: relative; top: -26px; height: 1px; border-right-style: none;
border-bottom-style: none;">
<tr>





Similar Threads
Thread Thread Starter Forum Replies Last Post
Forums don't really work - posts don't show up Rachel BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 7 February 23rd, 2009 03:04 PM
xslt slide show kawlaelo XSLT 6 February 13th, 2007 10:41 AM
Image slide-show Rajarshi HTML Code Clinic 1 February 27th, 2006 06:03 AM
Slide Show #1 (New User) WebDevel Javascript How-To 1 March 15th, 2005 09:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.