FRONTPAGE IMAGE REFRESH

M

MohitAggarwal2

I am using Frontpage to create my homepage and wanted to be able to
have the image refresh everytime someone visits the site. e.g. i have 5
pictures and each time there is a visitor he/she may see image1 or
image 4, etc.

i want to do this without having the whole page refreshed.

i have tried different html codes but have come up empty. i have tried
using php codes and same result. i have heard that this html code is
fairly easy to manage.

i have files on my desktop and on my server, hope this helps.

thanks
 
N

nice.guy.nige

While the city slept, (e-mail address removed) ([email protected])
feverishly typed...
I am using Frontpage to create my homepage

Ditch that... Frontpage is for pussies! ;-)
have the image refresh everytime someone visits the site. e.g. i have
5 pictures and each time there is a visitor he/she may see image1 or
image 4, etc.
Ok...

i want to do this without having the whole page refreshed.

Fair point...
i have tried different html codes but have come up empty.

html won't help you here
i have tried using php codes and same result. [...]

What php code are you using? That is the way to go really, you need some php
to pick an image at random and output it. Give us a link to your page, and
paste some php code you have tried and we can take it from there.

Cheers,
Nige
 
M

Mike Massonnet

Le Thu, 20 Jul 2006 00:32:14 +0100, nice.guy.nige a écrit :
html won't help you here

An iframe could do it.. but it is not of good taste to me.

Mike
 
N

Nik Coughlin

Mike said:
Le Thu, 20 Jul 2006 00:32:14 +0100, nice.guy.nige a écrit :


An iframe could do it.. but it is not of good taste to me.

No it couldn't, not by itself anyway
 
R

Rik

i have tried different html codes but have come up empty. i have tried
using php codes and same result. i have heard that this html code is
fairly easy to manage.

Hmmz, how hard is it to:

<?php
$images = array('image1.jpg', 'image2.jpg, 'image3.jpg'......);
$rand = mt_rand(0, (count($images-1));
echo '<img scr="'.$images[$rand].'" alt="You_do_provide_an_alt_do_you?"/>';
?>

Grz,
 
A

Andy Dingley

I am using Frontpage

Bad idea!

FrontPage is a bad product and makes bad sites. It also encourages web
design as a "black box" with no understanding. When you're working at
this level, you're starting to run off the edges of what it's capable
of.
have the image refresh everytime someone visits the site. e.g. i have 5
pictures and each time there is a visitor he/she may see image1 or
image 4, etc.

You need some scripting to do this, but it can be either server-side
(maybe PHP?) or client-side (JavaScript).

It's a good use for JavaScript, because it's easy to do, doesn't
require the page to be refreshed, and the complaints of "What happens
if JavaScript is disabled?" don't matter because it's only an "extra"
feature, not an essential one.

Make a plain HTML page (no need for an iframe) that loads up a couple
of images. Get the presentation right.

Now add some JavaScript to the <body onload="..." > event. Randomly
load some other images and swap them in. Possibly add a timer to change
them in the future. This is all easy, standard stuff, so some web
searching should find examples. You might search under "banner ad
rotator". I suggest you don't load _random_ images, but instead base
them on the browser's clock. This tends to change more evenly and to
look "more random" in practice.

If you do this server-side it's easy too. Just choose the images before
sending the page. Also make sure that page caching is short enough that
the page gets re-loaded when it's time to change the images. Even using
the <meta> tags is enough, if a little crude.

I also suggest you keep these images in their own directory with names
1.jpg ... 10.jpg etc. They can easily be copied and duplicated from
other parts of the site. This way you can easily set whole new sets of
images, if you want to make a major update (holiday themes etc.). It's
also to check your images are the right size!

i want to do this without having the whole page refreshed.

Then choose the client-side approach, but this isn't really a big issue
anyway. It's OK to let the page re-load "wastefully" a few times, if it
saves you coding effort.

i have tried different html codes but have come up empty.

You can't possibly do this in pure HTML alone.
 

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

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,271
Latest member
BuyAtenaLabsCBD

Latest Threads

Top