WEB Site - Different Pictures

A

ALX

I would like to have a different picture appear each time you open my web
site. Can anyone tell me how I cn do this?
 
M

Murray

Simple.

Put this in the head of the page -

<script type="text/javascript">
<!--
function displayRandomImage(imageName,array){
document.images[imageName].src=array[new Date().getTime()%array.length];
}
urls=["images/cs1.jpg","images/cs2.jpg","images/cs3.jpg","images/cs4.jpg"]

//-->
</script>

(adjust the urls line to list the pathnames of the image files you want to
use)

then make the body tag like this (preserving other content already there, if
necessary) -

<body onLoad="displayRandomImage('yourimagename',urls)" ...>

where "yourimagename" is replaced with the HTML name of the image that you
want randomly selected.
 
M

Michael

This solves my problem too! Does it work with a SHARED BORDER? Do I need to
make this change in the top.htm file or in any file using the Shared Border?

Michael

Murray said:
Simple.

Put this in the head of the page -

<script type="text/javascript">
<!--
function displayRandomImage(imageName,array){
document.images[imageName].src=array[new Date().getTime()%array.length];
}
urls=["images/cs1.jpg","images/cs2.jpg","images/cs3.jpg","images/cs4.jpg"]

//-->
</script>

(adjust the urls line to list the pathnames of the image files you want to
use)

then make the body tag like this (preserving other content already there, if
necessary) -

<body onLoad="displayRandomImage('yourimagename',urls)" ...>

where "yourimagename" is replaced with the HTML name of the image that you
want randomly selected.

--
Murray

ALX said:
I would like to have a different picture appear each time you open my web
site. Can anyone tell me how I cn do this?
 
M

Murray

Is the image you are "rotating" part of the shared border (I hope not!)?

--
Murray

Michael said:
This solves my problem too! Does it work with a SHARED BORDER? Do I need
to
make this change in the top.htm file or in any file using the Shared
Border?

Michael

Murray said:
Simple.

Put this in the head of the page -

<script type="text/javascript">
<!--
function displayRandomImage(imageName,array){
document.images[imageName].src=array[new Date().getTime()%array.length];
}
urls=["images/cs1.jpg","images/cs2.jpg","images/cs3.jpg","images/cs4.jpg"]

//-->
</script>

(adjust the urls line to list the pathnames of the image files you want
to
use)

then make the body tag like this (preserving other content already there,
if
necessary) -

<body onLoad="displayRandomImage('yourimagename',urls)" ...>

where "yourimagename" is replaced with the HTML name of the image that
you
want randomly selected.

--
Murray

ALX said:
I would like to have a different picture appear each time you open my
web
site. Can anyone tell me how I cn do this?
 
M

Michael

I don't know about ALX, but, yes, mine are part of the shared border. (See
www.missioneperte.it.) THat's bad, huh?

Murray said:
Is the image you are "rotating" part of the shared border (I hope not!)?

--
Murray

Michael said:
This solves my problem too! Does it work with a SHARED BORDER? Do I need
to
make this change in the top.htm file or in any file using the Shared
Border?

Michael

Murray said:
Simple.

Put this in the head of the page -

<script type="text/javascript">
<!--
function displayRandomImage(imageName,array){
document.images[imageName].src=array[new Date().getTime()%array.length];
}
urls=["images/cs1.jpg","images/cs2.jpg","images/cs3.jpg","images/cs4.jpg"]

//-->
</script>

(adjust the urls line to list the pathnames of the image files you want
to
use)

then make the body tag like this (preserving other content already there,
if
necessary) -

<body onLoad="displayRandomImage('yourimagename',urls)" ...>

where "yourimagename" is replaced with the HTML name of the image that
you
want randomly selected.

--
Murray

I would like to have a different picture appear each time you open my
web
site. Can anyone tell me how I cn do this?
 
A

Andrew Murray

Yes, that's because it will change with every page loaded since you are reloading
the "shared" top.htm file every time you load a page with the border.

Murray said:
Is the image you are "rotating" part of the shared border (I hope not!)?

--
Murray

Michael said:
This solves my problem too! Does it work with a SHARED BORDER? Do I need
to
make this change in the top.htm file or in any file using the Shared
Border?

Michael

Murray said:
Simple.

Put this in the head of the page -

<script type="text/javascript">
<!--
function displayRandomImage(imageName,array){
document.images[imageName].src=array[new Date().getTime()%array.length];
}
urls=["images/cs1.jpg","images/cs2.jpg","images/cs3.jpg","images/cs4.jpg"]

//-->
</script>

(adjust the urls line to list the pathnames of the image files you want
to
use)

then make the body tag like this (preserving other content already there,
if
necessary) -

<body onLoad="displayRandomImage('yourimagename',urls)" ...>

where "yourimagename" is replaced with the HTML name of the image that
you
want randomly selected.

--
Murray

I would like to have a different picture appear each time you open my
web
site. Can anyone tell me how I cn do this?
 
A

Andrew Murray

Yes, that's bad.

Essentially Shared Borders are sort-of like Server Side Includes - the included
file will load with each page using it, therefore your rotating-image-on-load
will load a new image each time that shared border file is loaded and that is
each and every time you go to a different page, a new image will load. If that's
what you want, fine, but it is not going to occur as a once-off event.

Where if you have a single page with no borders, then the image will load once
for that session, or until that page is revisited.


Michael said:
I don't know about ALX, but, yes, mine are part of the shared border. (See
www.missioneperte.it.) THat's bad, huh?

Murray said:
Is the image you are "rotating" part of the shared border (I hope not!)?

--
Murray

Michael said:
This solves my problem too! Does it work with a SHARED BORDER? Do I need
to
make this change in the top.htm file or in any file using the Shared
Border?

Michael

:

Simple.

Put this in the head of the page -

<script type="text/javascript">
<!--
function displayRandomImage(imageName,array){
document.images[imageName].src=array[new Date().getTime()%array.length];
}
urls=["images/cs1.jpg","images/cs2.jpg","images/cs3.jpg","images/cs4.jpg"]

//-->
</script>

(adjust the urls line to list the pathnames of the image files you want
to
use)

then make the body tag like this (preserving other content already there,
if
necessary) -

<body onLoad="displayRandomImage('yourimagename',urls)" ...>

where "yourimagename" is replaced with the HTML name of the image that
you
want randomly selected.

--
Murray

I would like to have a different picture appear each time you open my
web
site. Can anyone tell me how I cn do this?
 
M

Michael

Do I put this code in the top.htm page?

Andrew Murray said:
Yes, that's because it will change with every page loaded since you are reloading
the "shared" top.htm file every time you load a page with the border.

Murray said:
Is the image you are "rotating" part of the shared border (I hope not!)?

--
Murray

Michael said:
This solves my problem too! Does it work with a SHARED BORDER? Do I need
to
make this change in the top.htm file or in any file using the Shared
Border?

Michael

:

Simple.

Put this in the head of the page -

<script type="text/javascript">
<!--
function displayRandomImage(imageName,array){
document.images[imageName].src=array[new Date().getTime()%array.length];
}
urls=["images/cs1.jpg","images/cs2.jpg","images/cs3.jpg","images/cs4.jpg"]

//-->
</script>

(adjust the urls line to list the pathnames of the image files you want
to
use)

then make the body tag like this (preserving other content already there,
if
necessary) -

<body onLoad="displayRandomImage('yourimagename',urls)" ...>

where "yourimagename" is replaced with the HTML name of the image that
you
want randomly selected.

--
Murray

I would like to have a different picture appear each time you open my
web
site. Can anyone tell me how I cn do this?
 
Top