Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to display thumbnails in an iframe

Status
Not open for further replies.

latchmere

Technical User
Nov 20, 2002
2
0
0
GB
I have the code as follows for the thumbnail page. The images are saved in "images/A or B etc../ 01_thumb.jpg"
I think theres something wrong with the children.changepic bit. The thumbnails display a space for the image but not the image itself!

Please help!

<table cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; border=&quot;0&quot;>
<tr>
<script language=&quot;JavaScript&quot;>
<!--
for (i=1;i<num;i++) {
if (i<10) {
str=&quot;0&quot; + i;
} else {
str=&quot;&quot; + i;
}
document.write('<td><a href=&quot;javascript:parent.changepic(\''+str+'\');&quot;><img src=&quot;images/'+foldername+'/'+str+'_thumb.jpg&quot; border=&quot;3&quot;></a></td>');
document.write('<td><img src=&quot;images/spacer.gif&quot; width=&quot;8&quot; height=&quot;1&quot;></td>');
}
//-->
</script>
</tr>
</table>

 
Hi Latchmere,
Please use the modified function below to display the thumbnail using dynamically provided folder name. In the sample code i have hard coded folder name as &quot;A&quot; and Num=&quot;11&quot; but you can pass it as parameter if you wish.
Hope this will help [bigcheeks]

function showThumbnail()
{ var num=11;
var foldername = &quot;A&quot;;

document.write(&quot;<table cellpadding=2 cellspacing=0 border=0><tr>&quot;);
for (var i=1;i<num;i++) {
if (i<10) {
var str=&quot;0&quot; + i;
} else {
var str=&quot;&quot; + i;
}
document.write(&quot;<td><a href='javascript:parent.changepic(\'&quot;+str+&quot;\');'><img src='images/&quot;+foldername+&quot;/&quot;+ str+ &quot;_thumb.jpg' border=3></a></td>&quot;);
document.write(&quot;<td><img src='images/spacer.gif' width=8 height=1></td>&quot;);
}
}
document.write(&quot;</tr></table>&quot;);

</script>

Please also make sure that path of the folder is correct and so is the image file name.
Experience teaches slowly and at the cost of mistakes [pipe]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top