Thread: Image Loop
View Single Post
Old 08-28-2006, 10:13 AM   #1 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
Image Loop

Upon achieving the following code to display images from a folder, in ascending order of number. is there anyway to display all images in the folder upon the page loading? As at the moment this can only be done through a button being clicked.

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body onload="show()">
<script type="text/javascript">
var images = new Array();
var path = "media/";
var filename = 0;

function show()
{
  images[images.length]='<a href="'+path+filename+'.wmv"</a><img src="'+path+filename+'.jpg">'
  document.getElementById('pictures').innerHTML=images
  filename++;
}

</script>
<input type="submit" name="Submit" onclick="show()" value="Submit">
<div style="color=white;" id="pictures"></div>
</body>
</html>
Many Thanks,
__________________
Many Thanks, in advance!

Salchester.
The Future Is Here - Are You Ready?
Salchester is offline   Reply With Quote