Connecting Tech Pros Worldwide Forums | Help | Site Map

Time dependent image display

christian
Guest
 
Posts: n/a
#1: Jul 20 '05
Hi,

i'm getting no success, with my attempt
displaying some pictures one after another
for i.e. some seconds.

null.jpg is a white site!

Really thanks for any help,
regards,Christian


<html>
<SCRIPT type="text/javascript">
function image_on()
{ setTimeout("image_off()",4000)}

function image_off()
{document.images[0].src=(c:/omninet/null.jpg)}

</SCRIPT>
<body>

<IMG onLoad="image_on()" src=/picture1.jpg >

<IMG onLoad="image_on()" src=/picture2.jpg>

<IMG onLoad="image_on()" src=/picture3.jpg>

</body>
</html>

George Ziniewicz
Guest
 
Posts: n/a
#2: Jul 20 '05

re: Time dependent image display



"christian" <ozric@web.de> wrote in message
news:1a3a333a.0308120414.4fd9e343@posting.google.c om...[color=blue]
> Hi,
>
> i'm getting no success, with my attempt
> displaying some pictures one after another
> for i.e. some seconds.[/color]

Generally the way it is done is for you to place the pic names in an
array, and sequentially load them via a timer() using an incrementing
counter as an array index. Here is an IE slideshow I wrote:

http://zintel.com/picsel.html

Another version: http://zintel.com/snaps.html


[color=blue]
> null.jpg is a white site!
>
> Really thanks for any help,
> regards,Christian
>
>
> <html>
> <SCRIPT type="text/javascript">
> function image_on()
> { setTimeout("image_off()",4000)}
>
> function image_off()
> {document.images[0].src=(c:/omninet/null.jpg)}
>
> </SCRIPT>
> <body>
>
> <IMG onLoad="image_on()" src=/picture1.jpg >[/color]

I don't see an onLoad method n the IMG spec.

It is good practice to wrap your attribute values in quotes, here the
"/picture1.jpg"


[color=blue]
> <IMG onLoad="image_on()" src=/picture2.jpg>
>
> <IMG onLoad="image_on()" src=/picture3.jpg>
>
> </body>
> </html>[/color]

zin



George Ziniewicz
Guest
 
Posts: n/a
#3: Jul 20 '05

re: Time dependent image display



"George Ziniewicz" <zin1@cox.net> wrote in message
news:1c6_a.55870$Ne.16097@fed1read03...[color=blue]
>
> "christian" <ozric@web.de> wrote in message
> news:1a3a333a.0308120414.4fd9e343@posting.google.c om...[color=green]
> > Hi,
> >
> > i'm getting no success, with my attempt
> > displaying some pictures one after another
> > for i.e. some seconds.[/color]
>
> Generally the way it is done is for you to place the pic names in an
> array, and sequentially load them via a timer() using an incrementing
> counter as an array index. Here is an IE slideshow I wrote:
>
> http://zintel.com/picsel.html
>
> Another version: http://zintel.com/snaps.html
>
>
>[color=green]
> > null.jpg is a white site!
> >
> > Really thanks for any help,
> > regards,Christian
> >
> >
> > <html>
> > <SCRIPT type="text/javascript">
> > function image_on()
> > { setTimeout("image_off()",4000)}
> >
> > function image_off()
> > {document.images[0].src=(c:/omninet/null.jpg)}
> >
> > </SCRIPT>
> > <body>
> >
> > <IMG onLoad="image_on()" src=/picture1.jpg >[/color]
>
> I don't see an onLoad method n the IMG spec.[/color]

My mistake, there is one!


[color=blue]
> It is good practice to wrap your attribute values in quotes, here the
> "/picture1.jpg"
>
>
>[color=green]
> > <IMG onLoad="image_on()" src=/picture2.jpg>
> >
> > <IMG onLoad="image_on()" src=/picture3.jpg>
> >
> > </body>
> > </html>[/color]
>
> zin
>
>
>[/color]


andy johnson
Guest
 
Posts: n/a
#4: Jul 20 '05

re: Time dependent image display


On Tue, 12 Aug 2003 08:12:07 -0700, "George Ziniewicz" <zin1@cox.net>
wrote:
[color=blue]
>
>"George Ziniewicz" <zin1@cox.net> wrote in message
>news:1c6_a.55870$Ne.16097@fed1read03...[color=green]
>>
>> "christian" <ozric@web.de> wrote in message
>> news:1a3a333a.0308120414.4fd9e343@posting.google.c om...[color=darkred]
>> > Hi,
>> >
>> > i'm getting no success, with my attempt
>> > displaying some pictures one after another
>> > for i.e. some seconds.[/color]
>>
>> Generally the way it is done is for you to place the pic names in an
>> array, and sequentially load them via a timer() using an incrementing
>> counter as an array index. Here is an IE slideshow I wrote:
>>
>> http://zintel.com/picsel.html
>>
>> Another version: http://zintel.com/snaps.html
>>
>>[/color][/color]
So, for those of me who are not java literate but trying to grasp it,
can you post a stand alone working script ???

Thanks,

Andy

"There would be a lot more civility in this world if people
didn't take that as an invitation to walk all over you"
- (Calvin and Hobbes)
George Ziniewicz
Guest
 
Posts: n/a
#5: Jul 20 '05

re: Time dependent image display


"andy johnson" <andrew.johnson@chicagonet.net> wrote in message news:o28ijvo5ntgl5bdnl6oi72ohq9uhqcgf7v@4ax.com...
On Tue, 12 Aug 2003 08:12:07 -0700, "George Ziniewicz" <zin1@cox.net>
wrote:
[color=blue]
>
>"George Ziniewicz" <zin1@cox.net> wrote in message
>news:1c6_a.55870$Ne.16097@fed1read03...[color=green]
>>
>> "christian" <ozric@web.de> wrote in message
>> news:1a3a333a.0308120414.4fd9e343@posting.google.c om...[color=darkred]
>> > Hi,
>> >
>> > i'm getting no success, with my attempt
>> > displaying some pictures one after another
>> > for i.e. some seconds.[/color]
>>
>> Generally the way it is done is for you to place the pic names in an
>> array, and sequentially load them via a timer() using an incrementing
>> counter as an array index. Here is an IE slideshow I wrote:
>>
>> http://zintel.com/picsel.html
>>
>> Another version: http://zintel.com/snaps.html
>>
>>[/color][/color]
So, for those of me who are not java literate but trying to grasp it,
can you post a stand alone working script ???



Here is a fairly minimal slideshow (the minimum I would do), featuring a table centered pic, selectable delay, click to hold/continue, and onscreen info. All that needs changing is to set "base" to the basepath of your images like 'myFolder/birthday/') and put the pic names in the pic array list like 'file1.jpg','file1.gif' ...:


btw, here is a new "fullscreen" slideshow I posted today, I tried for cross-browser but w/ IE features, with zoom, filters, draggable and hideable menu, scrolling div info, etc:

http://zintel.com/cb_start.html

zin

---------------------------------------------------

<html><head><title>Minimal Slide Show</title>

<!-- --- style for a dark background, optional --- -->

<style type='text/css'>
body{
color:#FFFFFF;
background-color:#111111;
}
input{
text-align:center;
}
</style>

<!-- ------- script for slideshow functions ------- -->

<script type='text/javascript'>
<!-- hide script content from old browsers

var base='snaps/'; // base dir of images

var pics=new Array( // list of file names in dir to show
"k6077.jpg","k6080.jpg","k6086.jpg","k6088.jpg","k 6094.jpg"
);

var on=1; // run flag
var picnum=-1; // current pic #
var timerID=0;
var interval=3000; // 3 second delay

//----------------------------------------------------------
//----------------------------------------------------------
//----------------------------------------------------------

function advance() { // move to the next pic:
picnum+=1; // increment
picnum%=pics.length; // wraparound if necessary
}

//----------------------------------------------------------

function show() { // show current pic:
document.pic.src=base+pics[picnum]; // load it
document.pic.alt=pics[picnum]; // update alt
update();
}

//----------------------------------------------------------

function timer() {
if (on) { // if running
advance(); // next one
show(); // show it
}
timerID=setTimeout('timer()',interval); // next time
}

//----------------------------------------------------------

function toggle() {
switch (on) {
case 0: // if off
on=1;
advance();
show();
update();
timer();
break;
case 1: // if on
on=0;
update();
clearTimeout(timerID);
break;
}
}

//----------------------------------------------------------

function update() { // update onscreen info
var str;
if (on) {
str='PLAY: ';
document.myForm.myText.style.backgroundColor='whit e';
} else {
str='HOLD: ';
document.myForm.myText.style.backgroundColor='yell ow';
}
document.myForm.myText.value=str+pics[picnum]; // name
}

//----------------------------------------------------------

// ...end hiding content from old browsers -->
</script>
</head>

<!-- ----------------------------------------------------- -->
<!-- ----------------------------------------------------- -->
<!-- ----------------------------------------------------- -->

<body onLoad='timer();'>
<center>

<!-- --------------- form for widgets --------------- -->

<form name='myForm' onSubmit='return false'>
<input type='text' name='myText' width='20'>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

Delay:
<select onChange='clearTimeout(timerID);
interval=(selectedIndex+1)*1000; timer();'>
<option>1 <option>2 <option selected='selected'>3
<option>4 <option>5 <option>6 <option>7 <option>8
</select>
Sec.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

Click Pic to Hold or Continue
<br />
</form>

<!-- --------- table to hold a centered pic --------- -->

<table align='center' valign='middle' height='100%' border='0'>
<tr><td align='center' valign='middle'>
<img src='' name='pic' id='pic' onClick='toggle();'>
</td></tr>
</table>

</center>
</body>
</html>


Patrick Fitzgerald
Guest
 
Posts: n/a
#6: Jul 20 '05

re: Time dependent image display


ozric@web.de (christian) wrote in message news:<1a3a333a.0308120414.4fd9e343@posting.google. com>...[color=blue]
>
> i'm getting no success, with my attempt
> displaying some pictures one after another
> for i.e. some seconds.[/color]

You can check out my site for an example:

http://slideshow.barelyfitz.com/
Closed Thread