473,569 Members | 2,575 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

creating a slide show effect with setTimeout for a museum

I am working on a kiosk for a museum, we will be using firefox as the
browser, with windows, and a touch screen.

We'd like to create a slide show of a small portfolio when the visitors
click down to the lowest level of the collection.
For instance, after choosing Africa, then Sudan, they will choose what
they would like to look at: jewelry, tapestry, metals, etc. When they
choose tapestry, there will be groups of ten thumbnails. These are a
portfolio. If they want to see that group of thumbnails in detail, they
would hit the slide show feature. We'd like the following page to
scroll through the series of 10 images. The portfolio will create the
1-10 linking and next buttons.
What I'd like to do is hide the 1-10 and next button and use
setTimeOut or something similar to tell the browser to go to the next
page in the set every 5-10 seconds.
I'm open to any suggestions out there.

Jul 23 '05 #1
7 3046
Sounds like something that flash is ideally suited for.

"7mary4" <7m****@gmail.c om> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
I am working on a kiosk for a museum, we will be using firefox as the
browser, with windows, and a touch screen.

We'd like to create a slide show of a small portfolio when the visitors
click down to the lowest level of the collection.
For instance, after choosing Africa, then Sudan, they will choose what
they would like to look at: jewelry, tapestry, metals, etc. When they
choose tapestry, there will be groups of ten thumbnails. These are a
portfolio. If they want to see that group of thumbnails in detail, they
would hit the slide show feature. We'd like the following page to
scroll through the series of 10 images. The portfolio will create the
1-10 linking and next buttons.
What I'd like to do is hide the 1-10 and next button and use
setTimeOut or something similar to tell the browser to go to the next
page in the set every 5-10 seconds.
I'm open to any suggestions out there.

Jul 23 '05 #2
"7mary4" <7m****@gmail.c om> skrev i meddelandet
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
I am working on a kiosk for a museum, we will be using firefox as the
browser, with windows, and a touch screen.

We'd like to create a slide show of a small portfolio when the visitors
click down to the lowest level of the collection.
For instance, after choosing Africa, then Sudan, they will choose what
they would like to look at: jewelry, tapestry, metals, etc. When they
choose tapestry, there will be groups of ten thumbnails. These are a
portfolio. If they want to see that group of thumbnails in detail, they
would hit the slide show feature. We'd like the following page to
scroll through the series of 10 images. The portfolio will create the
1-10 linking and next buttons.
What I'd like to do is hide the 1-10 and next button and use
setTimeOut or something similar to tell the browser to go to the next
page in the set every 5-10 seconds.
I'm open to any suggestions out there.


Give the pictures files names like "picture_1. jpg" to "picture_10.jpg ". Then
give the <img> an id. Then have a function that gets the img with
getElementById( ), finds out what the src is, strips off the trailing
numeral, increments trailing numeral, sets src to the appropriate file name,
then if there are pictures left to show calls setTimeout() with a function
call to itself as one parameter and 5000 (milliseconds) as the second
parameter. (the picture dimensions have to be identical for this to work, as
width/height isn't updated, I believe - though you could write a function
that replaces the entire <img> tag)

Or do something similar with named HTML documents (possibly
server-generated, with query strings: myslideshow.htm ?picid=1) and setting
document.locati on.href.

Personally I hate slide shows with too long intervals. As everyone has their
own viewing rhythm, a "next" button might be a good idea.

Joakim Braun
Jul 23 '05 #3
On Thu, 30 Dec 2004 11:37:06 +0100, Joakim Braun
<jo**********@j fbraun.removeth is.com> wrote:

[snip]
Then have a function that gets the img with
getElementById( ),
Use the images collection instead. It should be quicker, it involves
typing and it's self-documenting. If you add a name attribute to the image
with the same value as the id, use of the images collection expands your
target audience to include older browsers, too.

[snip]
(the picture dimensions have to be identical for this to work, as
width/height isn't updated, I believe
If you set the width or height attributes explicitly, then yes, you'd
either have to update them along with the image, or make all of the images
the same size. If you don't set those attributes, the element will grow or
shrink to fit.
though you could write a function that replaces the entire <img> tag)
Why? Is there some reason, of which I'm not aware, where

img.width = x; // and .height where x is a number in pixels

won't work?
Personally I hate slide shows with too long intervals. As everyone has
their own viewing rhythm, a "next" button might be a good idea.


I wrote a slide show script two days ago, but the code was ugly and I
couldn't be bothered to test it properly, so I deleted it. It was fairly
versatile. Perhaps I should re-write it.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #4
"Michael Winter" <M.******@bluey onder.co.invali d> skrev i meddelandet
news:opsjtkbxe1 x13kvk@atlantis ...
On Thu, 30 Dec 2004 11:37:06 +0100, Joakim Braun
<jo**********@j fbraun.removeth is.com> wrote:

<snip>
though you could write a function that replaces the entire <img> tag)


Why? Is there some reason, of which I'm not aware, where

img.width = x; // and .height where x is a number in pixels

won't work?


If you start out with an <img> with height/width attributes, then want to
replace the src with an image with different height/width, and don't want to
hard code the dimensions, you could replace the entire node and have the
browser figure out height/width as for an <img> without height/width.

But on reflection, there is removeAttribute ()/removeAttribute Node(). Or
perhaps you could simply set the <img> height/width to null?

Joakim Braun
Jul 23 '05 #5
"Joakim Braun" <jo**********@j fbraun.removeth is.com> skrev i meddelandet
news:1K******** *********@nntps erver.swip.net. ..
"Michael Winter" <M.******@bluey onder.co.invali d> skrev i meddelandet
news:opsjtkbxe1 x13kvk@atlantis ...
On Thu, 30 Dec 2004 11:37:06 +0100, Joakim Braun
<jo**********@j fbraun.removeth is.com> wrote: <snip>
though you could write a function that replaces the entire <img> tag)


Why? Is there some reason, of which I'm not aware, where

img.width = x; // and .height where x is a number in pixels

won't work?


If you start out with an <img> with height/width attributes, then want to
replace the src with an image with different height/width, and don't want

to hard code the dimensions, you could replace the entire node and have the
browser figure out height/width as for an <img> without height/width.

But on reflection, there is removeAttribute ()/removeAttribute Node(). Or
perhaps you could simply set the <img> height/width to null?


Or don't use height/width at all.

Joakim Braun
Jul 23 '05 #6
On Thu, 30 Dec 2004 13:46:31 +0100, Joakim Braun
<jo**********@j fbraun.removeth is.com> wrote:

[snip]
Or don't use height/width at all.


That's what I implied:

"If you set the width or height attributes explicitly, then yes,
you'd [...] have to update them [...]"

In other words, if you leave the dimensions to be defined implicitly (by
the image itself), you wouldn't have to do anything. :)

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #7
here is a solution for your ten images with 5 sec interval:

<script type="text/javascript">
var image1=new Image()
image1.src="1.g if"
var image2=new Image()
image2.src="2.g if"
var image3=new Image()
image3.src="3.g if"
var image4=new Image()
image4.src="4.g if"
var image5=new Image()
image5.src="5.g if"
var image6=new Image()
image6.src="6.g if"
var image7=new Image()
image7.src="7.g if"
var image8=new Image()
image8.src="8.g if"
var image9=new Image()
image9.src="9.g if"
var image10=new Image()
image10.src="10 .gif"

</script>
</head>

<body>
<img src="1.gif" name="slide" >
<script type="text/javascript">
//variable that will increment through the images
var step=1
function slideit(){
//if browser does not support the image object, exit.
if (!document.imag es)
return
document.images .slide.src=eval ("image"+step+" .src")
if (step<10)
step++
else
step=1
}
var lock=false
var run
function show(){
if(lock==true){
lock=false;
window.clearInt erval(run);
}
else if (lock == false) {
lock = true;
run = setInterval("sl ideit()", 5000);
}
}
</script>
<body Onload=show()>
"Joakim Braun" <jo**********@j fbraun.removeth is.com> escreveu na mensagem
news:LM******** *********@nntps erver.swip.net. ..
"Joakim Braun" <jo**********@j fbraun.removeth is.com> skrev i meddelandet
news:1K******** *********@nntps erver.swip.net. ..
"Michael Winter" <M.******@bluey onder.co.invali d> skrev i meddelandet
news:opsjtkbxe1 x13kvk@atlantis ...
> On Thu, 30 Dec 2004 11:37:06 +0100, Joakim Braun
> <jo**********@j fbraun.removeth is.com> wrote:

<snip>
> > though you could write a function that replaces the entire <img> tag)
>
> Why? Is there some reason, of which I'm not aware, where
>
> img.width = x; // and .height where x is a number in pixels
>
> won't work?


If you start out with an <img> with height/width attributes, then want to
replace the src with an image with different height/width, and don't want

to
hard code the dimensions, you could replace the entire node and have the
browser figure out height/width as for an <img> without height/width.

But on reflection, there is removeAttribute ()/removeAttribute Node(). Or
perhaps you could simply set the <img> height/width to null?


Or don't use height/width at all.

Joakim Braun

Jul 23 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3462
by: Al Davis | last post by:
Note: I tried cross-posting this message to several newsgoups, including comp.lang.perl.misc, c.l.p.moderated, comp.infosystems.www.authoring.cgi, comp.lang.javascript and comp.lang.php. Nothing appeared on my news server, so I'm trying again - this time posting a separate copy of the message to each group. I'm thinking this should be...
1
4308
by: ajay | last post by:
I have following code for a slide menu but i twiked it to work for a single level menu. Open it in a Browser to get a clear picture. I have 2 Qs 1) How to make first entry as non-link. i.e i want to make first text as Table Heading/menu category. For examle in the given menu i want to make a heading as "Comp. Languages" which won't be a...
9
12387
by: Michael Burtenshaw | last post by:
I would like to make a slide show using random images. The problem is my host is 250.com, and they don't support cgi-programs. Is there another way to accomplish random images?
3
4019
by: Wazz Up | last post by:
Hi, I'm trying run an image slide show where the images rotate once each, then after the last image in the array has been displayed for the specified amount of time, a redirection to another page occurs. The problem I'm having is that the redirection happens as soon as the last image is displayed. Here's an example of a normal version...
7
3055
by: Rudy | last post by:
Hello All! After working in the television industry, moving to a developing career has been interesting to say the least. 3 years of developing with books, and the help of you fine folks on this forum, I have learned quite a bit. But that doesn't mean anything when your looking for your first developing gig. 15 years in television...
3
1839
by: ATS | last post by:
I'm trying to set up a slide show on a web page using Javascript. Here is the code I have so far: <script language="javascript"> alert("**in test area 1"); slides = new Array(); slides = new Image(); slides = new Image();
1
1628
by: GabrielESandoval | last post by:
I am converting powerepoint presentations to images I want to display as slide shows. My questions is I want it so that when a link is clike the slide show opens. The slides will be initially timed but there are also controls so that if they want to go back or advance the images at their own pace. Is this too complicated?? I know how to...
1
1399
by: The Starmaker | last post by:
Is there a command I can add to this script that will end the slideshow at the last image so it doesn't run continously? Pic = '1.jpg' Pic = '2.jpg' Pic = '3.jpg' Pic = '4.jpg' Pic = '5.jpg' (stop here)
3
5242
by: Beamer | last post by:
Hi I am trying to build a roating slide effect in javascript. Basically, I have a list like below <ul id="slideShowCnt"> <li id="slide0"><img .../></li> <li id="slide0"><img .../></li> <li id="slide0"><img .../></li> <li id="slide0"><img .../></li> <li id="slide0"><img .../></li> <li id="slide0"><img .../></li>
0
7628
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8145
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7694
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6317
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3679
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2128
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.