|
Posted by Andy Dingley on 12/10/35 11:53
MohitAggarwal2@gmail.com wrote:
> 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.
Navigation:
[Reply to this message]
|