Is there a script that will list images that are in a directory, and then open the image (*.jpg) within IE when clicked on. This will prevent the manual html coding of each image, so that new images can just be added to the directory without having to "hard" code them in.
Does that make sense?
Thanks a bunch,
Jason.
codegoboom
11-24-2004, 11:02 PM
It can be done from a local HTML Application, or configuration script, if that's where your directory is. Otherwise, it would probably require server-side scripting.
gaBRiel
11-24-2004, 11:46 PM
if the images are in the same directory as the html page(as codegoboom said), you can name the images with names like:'image1, image2, image3' or 'pic1, pic2, pic3,etc' and do this:
<script>
i=0
img_width=1
var pics=new Array()
while(img_width>0){
var pics[i]=new Image()
pics[i].src=http://www.codingforums.com/archive/index.php/"pics"+i+".jpg"
if(pics[i].width=0){
img_width=0
}
}
</script>
this (hopefully) should call the images in your folder and store them in a array, if the image exists, its width will be greater than 0, so it will continue the loop and store images. If it summons an image that doesnīt exist, this imageīs width will be 0, and it will stop the loop.
then to call the images:
<body>
<script>
i2=0
while(i2<i){
document.write("<a href='pics"+i2+".jpg'>image"+i2+"</a>")
i2++
}
</script>
hope thatīs what you wanted and hope that works.
codegoboom
11-25-2004, 01:20 AM
Ah, that sounds feasible. :)