Digital Point Forums
Winn Law Group

Go Back   Digital Point Forums > Design & Development > Programming > JavaScript
Google Analytics
Log In to view
your analytics

Reply
 
Thread Tools
  #1  
Old Apr 6th 2005, 5:02 am
jamie smith jamie smith is offline
Peon
 
Join Date: Mar 2005
Posts: 3
jamie smith is on a distinguished road
Slideshow start delay

Hi
Iv adapted a slideshow script so that it appears twice on the same page. It works but I want to put a start delay on one of the slideshows to make the images change in sequance. Does anyboody know the bit of code I need to do it?
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>

<script>
// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 3000
var slideShowSpeed2 = 3000
// Duration of crossfade (seconds)
var crossFadeDuration = 3

// Specify the image files
var Pic = new Array()
var Pic2 = new Array()

Pic[0] = 'pic/bcn1.jpg'
Pic[1] = 'pic/bcn2.jpg'
Pic[2] = 'pic/bcn3.jpg'
Pic[3] = 'pic/bcn4.jpg'

Pic2[0] = 'pic/bcn1.jpg'
Pic2[1] = 'pic/bcn2.jpg'
Pic2[2] = 'pic/bcn3.jpg'
Pic2[3] = 'pic/bcn4.jpg'

// =======================================
// do not edit anything below this line
// =======================================
var k = 0
var t
var j = 0
var p = Pic.length
var p2 = Pic2.length

var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

var preLoad2 = new Array()
for (i = 0; i < p2; i++){
   preLoad2[i] = new Image()
   preLoad2[i].src = Pic2[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()      
   }
   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)
}
function runSlideShow2(){
   if (document.all){
      document.images.SlideShow2.style.filter="blendTrans(duration=2)"
      document.images.SlideShow2.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow2.filters.blendTrans.Apply()      
   }
   document.images.SlideShow2.src = preLoad2[k].src
   if (document.all){
      document.images.SlideShow2.filters.blendTrans.Play()
   }
   k = k + 1
   if (k > (p2-1)) k=0
   t = setTimeout('runSlideShow2()', slideShowSpeed2)
}
</script>  


</head>

<body onload="runSlideShow(); runSlideShow2()">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="VU" height=220 width=330>
<img src="1.jpg" name='SlideShow' width=330 height=220></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="VU" height=220 width=330>
<img src="1.jpg" name='SlideShow2' width=330 height=220></td>
</tr>
</table>
</body>
</html>
thankyou
Reply With Quote
  #2  
Old Apr 10th 2005, 12:06 am
J.D. J.D. is offline
of the Nightfall
 
Join Date: Nov 2004
Posts: 1,198
J.D. has a spectacular aura aboutJ.D. has a spectacular aura about
Use setTimeout. For example, this code will show an alert after 3 seconds:

<body onload="window.setTimeout('alert(0)', 3000)">
</body>

J.D.
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DVD Photo Slideshow Software? donelle8 General Chat 1 Feb 24th 2009 1:08 am
Slideshow hyperlinks jamie smith JavaScript 2 Mar 17th 2008 11:40 am
Good start up frankybme Affiliate Programs 5 Jun 24th 2005 1:51 am
Help a newbie, where to start?? Z06Tim Affiliate Programs 4 Sep 20th 2004 4:35 pm
When does "relevant" start? Owlcroft AdSense 5 Sep 7th 2004 9:56 pm


All times are GMT -8. The time now is 11:37 pm.