[thelist] Slide show with html text

Javier Muniz jmuniz at granicus.com
Wed Oct 15 16:57:16 CDT 2003


Hi,

I just typed this in, didn't test it, could have typos or some simple logic
errors, but I'm pretty sure it will get you where you want to be with a
little bit of hacking around.  Won't make the page flicker, and it will
rewrite the text as well as changing the slide.  Also supports html within
the SlideText array, though there may be DOM implications since it uses
innerHTML, nothing that should cause serious errors.

Cheers!

-Javier

<html>
<head>
<script language="JavaScript">
var i = 0;
var timerID = 0;
var SlideImages = new array();
SlideImages[0] = new Image(); SlideImages[0].src = "img/slide1.jpg";
SlideImages[1] = new Image(); SlideImages[1].src = "img/slide2.jpg";
SlideImages[2] = new Image(); SlideImages[2].src = "img/slide3.jpg";
...

var SlideText = new array();
SlideText[0] = "Slide 1 text goes here";
SlideText[1] = "Slide 2 text goes here";
SlideText[2] = "You know what goes here";
...

function nextslide() {
  if(timerID) {
    clearTimeout(timerID);
    i++;
  }
  var slide = document.getElementById("slideimage");
  var text = document.getElementById("slidetext");
  slide.src = SlideImages[i].src;
  text.innerHTML = SlideText[i];
  timerID = setTimeout("nextslide()",9000)
}
</script>
</head>
<body onload="nextslide()">
<table>
<tr><td><img id="slideimage" src="spacer.gif"></td>
<tr><td id="slidetext">&nbsp;</td></tr>
</table>
</body>
</html>

-----Original Message-----
From: Jono Young [mailto:Jono at brookgroup.com] 
Sent: Wednesday, October 15, 2003 11:31 AM
To: thelist lists.evolt.org
Subject: Re: [thelist] Slide show with html text


I am leaning towards JS only b/c that is what I used to create other graphic
only slideshows.  I figured it would be easier, but I am new to this so it
is tough to make a decision on what direction to take.  I will give your
suggestion a shot.

On 10/15/03 1:02 PM, "John C Bullas" <jcbullas at nildram.co.uk> wrote:

> At 16:34 15/10/2003, Jono Young wrote:
>> Thanks you everyone for your input and suggestions thus far.  I am 
>> digging into the details of all past suggestions, and the answer is 
>> definitely getting closer.  I know there's a way to pull this off 
>> with
> 
> Why use J Script as you only have a few slides and metatag "redirect" 
> will work fine? FB
> 
>> Javascript...somebody must know.  Where are you....help!

-- 
Jono Young
Designer/Illustrator
Brook Group, LTD
8231 Main Street
Ellicott City, MD 21043
T: 410-465-7805 xt: 16
<http://www.brookgroup.com/>

-- 
* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester 
and archives of thelist go to: http://lists.evolt.org 
Workers of the Web, evolt ! 


More information about the thelist mailing list