Joe said:
Hello,
I am trying to find inFP 2003 how to alternate pictures on
a web page I want to alternate between 3 if possible
Thank you
Joe
I don't think FP can do this automatically but it's easy with a little
scripting.
1) Name the images something like image01.jpg, image02.jpg, etc.
2) Create an array with the image sizes. THis is for 5 images:
dim w(10),h(10)
w(1) = 400
h(1) = 275
w(2) = 476
h(2) = 260
w(3) = 455
h(3) = 326
w(4) = 458
h(4) = 268
w(5) = 400
h(5) = 309
3) Generate a random number between 1 and the number of banners. Also create
a name suffix:
numbanners = 5
randomize
x = int(rnd() * numbanners) + 1
' Now x has a value between 1 and numbanners.
' Add leading zero.
if x < 10 then
suffix = "0" & right(x,1)
end if
4) Write the image tags to the page with the width and height:
<img src="IMAGES/stamps/stamp_banner<%=suffix%>.jpg" alt="stamp banner"
width="<%=w(x)%>" height="<%=h(x)%>" align="center">
You can see this in action at
www.pgacon.com/stampcol.asp
Peter Aitken