Image change when a page refreshes

J

Jenn

I am trying to set up a series of images that change when the page is
refreshed - not on a mouseover or click, but just when it reloads, so that on
each visit the image will be different. Can I do this with FP Behaviors?
I'm not much of a coder, so I'm trying to do it in FrontPage if possible.

Thanks,
Jenn
 
P

Peter Gniewek

Hi
You can create a Picture Based on Schedule using the insert web component.
To do this go to Insert, Web Component, on the component type select
Included Content and choose Picture Based Schedule.
 
M

Murray

Put this in the head of the document -

<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"]
// load this line with your image names and paths
//-->
</script>

and then put this in the body of the page -

<body onLoad="displayRandomImage('csmember',urls)">
<!-- csmember is the HTML NAME of the image receiving the random changes
(not the filename) -->
 
T

Thomas A. Rowe

However that method requires you to open the site in FP each time you want the change to happen.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
J

Jenn

Murrany,
thanks for the script - but what is the difference between the HTML name and
the filename for my random inage?

Murray said:
Put this in the head of the document -

<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"]
// load this line with your image names and paths
//-->
</script>

and then put this in the body of the page -

<body onLoad="displayRandomImage('csmember',urls)">
<!-- csmember is the HTML NAME of the image receiving the random changes
(not the filename) -->



--
Murray
Jenn said:
I am trying to set up a series of images that change when the page is
refreshed - not on a mouseover or click, but just when it reloads, so that
on
each visit the image will be different. Can I do this with FP Behaviors?
I'm not much of a coder, so I'm trying to do it in FrontPage if possible.

Thanks,
Jenn
 
M

Murray

<img name="htmlname" src="filename.gif"....>

--
Murray
============

Jenn said:
Murrany,
thanks for the script - but what is the difference between the HTML name
and
the filename for my random inage?

Murray said:
Put this in the head of the document -

<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"]
// load this line with your image names and paths
//-->
</script>

and then put this in the body of the page -

<body onLoad="displayRandomImage('csmember',urls)">
<!-- csmember is the HTML NAME of the image receiving the random changes
(not the filename) -->



--
Murray
Jenn said:
I am trying to set up a series of images that change when the page is
refreshed - not on a mouseover or click, but just when it reloads, so
that
on
each visit the image will be different. Can I do this with FP
Behaviors?
I'm not much of a coder, so I'm trying to do it in FrontPage if
possible.

Thanks,
Jenn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top