PDA

View Full Version : image display help


shout it
02-15-2009, 07:46 PM
i have been using a image display on a website the code is below:

<SCRIPT LANGUAGE="JavaScript">

var num=1
img1 = new Image ()
img1.src = "images/Street scene index page.jpg"
img2 = new Image ()
img2.src = "images/World Map.jpg"
img3 = new Image ()
img3.src = "message.gif"
img4 = new Image ()
img4.src = "nervous.gif"

text1 = "Text for Picture One AND ADSENSE"
text2 = "Text for Picture Two"
text3 = "Text for Picture Three"
text4 = "Text for Picture Four"

function slideshowUp()
{
num=num+1
if (num==5)
{num=1}
document.mypic.src=eval("img"+num+".src")
document.joe.burns.value=eval("text"+num)
}

function slideshowBack()
{
num=num-1
if (num==0)
{num=4}
document.mypic.src=eval("img"+num+".src")
document.joe.burns.value=eval("text"+num)
}

</SCRIPT>

<!-- The Image and Form Codes are Below -->

<CENTER>
<!-- Tag Scroller -->

<DIV STYLE="overflow: auto; width: 255; height: 255; border: 0 #000000 solid; text-align: center; padding: 2px">

<IMG SRC="images/World Map.jpg">
<p><!-- Enter Your Content Here -->

</DIV>


<FORM NAME="joe">
<INPUT TYPE="text" WIDTH="200" NAME="burns" VALUE="Text For Picture One" size="60">
</FORM>

<A HREF="javascript:slideshowBack()"> Back</A>

<A HREF="javascript:slideshowUp()"> Next</A>

What i want to do is to use software that uses placeholders within the code such as !!image 1!!, !!image 2!! that will get the results from a sql table and I have the option within the database of storing the image directly or the url to the image source.

I do like the way it displays images + captions but i want to do the following to it.

Whwn it loads the images will be shown as thumbnails that will automatically fit in the window, to still have the scroll ability. But when someone clicks on the thumbnail picture a new window will open showing the image in its actual size.

I want the script with captions or without.
Can anyone help please.
Thanks
Craig