|
Q393 How can I display every JPG image in a defined directory as a thumbprint image that when clicked brings up the image in full?
irt.org | Knowledge Base | JavaScript | Image | Q393 [ previous next ]
Q393 How can I display every JPG image in a defined directory as a thumbprint image that when clicked brings up the image in full?
You need an adaptation of the article
Reading the contents of a directory:
The test.htm document defines two frames:
<html>
<head>
<script language="JavaScript"><!--
function reload_main() { window.main.location.href = "main.htm"; }
//--></script>
</head>
<frameset rows="*,1" onLoad="reload_main()">
<frame src="blank.htm" name="main">
<frame src="../images/" name="directory">
</frameset>
</html>
|
The contents of blank.htm:
The contents of main.htm:
<html>
<body>
<h1>Contents of directory</h1>
<script language="JavaScript"><!--
var links_length = parent.directory.window.document.links.length;
var link = "";
for (var i = 0; i < links_length ; i++) {
link = parent.directory.window.document.links[i].href)
if (link.indexOf('.jpg')) {
document.write('<a href= "'+link+'"><img src="' + link + '" width="50" hight="50"><\/a>');
}
}
//--></script>
</body>
</html>
|
Feedback on 'Q393 How can I display every JPG image in a defined directory as a thumbprint image that when clicked brings up the image in full?'
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.