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?
site. Can anyone tell me how I cn do this?
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?
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?
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?
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?
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?
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?