I have a photogallery and want to have each photo in the gallery, when clicked, to open a CFWindow with just that img file in it.
CODE
<cfparam name="siteTitle" default="Login">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><cfoutput>#globalSiteTitle# :: #siteTitle#</cfoutput></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="/style.css" type="text/css">
</head>
<body>
<cfset localphotodir = localphotopath & url.folder>
<!---<cfdump var="#localphotodir#">--->
<cfdirectory action="list" directory="#localphotodir#" name="PhotoDirectory" listinfo="all" type="file" recurse="no">
<cfquery dbtype="query" name="photodirectory" maxrows="2">
SELECT * FROM photodirectory
</cfquery>
<cfinclude template="/common/incl_nav.cfm">
<!---<cfdump var="#PhotoDirectory#" expand="no">--->
<table cellpadding="3" cellspacing="3" border="0" align="center">
<thead>
<tr>
<th colspan="4"><cfoutput>#listFirst(url.folder,"_")#'s Photos</cfoutput></th>
</tr>
</thead>
<tbody>
<tr>
<cfset col = 1>
<cfset totalcol = 0>
<cfoutput query="PhotoDirectory">
<cfif col MOD 4 EQ 1>
<tr>
<cfset col = 1>
</cfif>
<cfset IMGPath = photopath & listFirst(url.folder,"\") & "/" & photodirectory.name>
<cfif isImageFile(ImgPath)>
<cfscript>
Thumb = ImageNew(IMGPath);
ImageResize(Thumb,"100","");
ImgHeight = Thumb.height;
ImgWidth = Thumb.width;
ImgName = ListLast(thumb.source,"/")
</cfscript>
<cfwindow name="#ImgName#" initshow="false" center="true" closable="true" draggable="true" height="#ImgHeight#" width="#ImgWidth#" title="#ImgName#"></cfwindow>
<td align="center">
<cfimage source="#thumb#" action="writetobrowser" border="0">
</td>
<cfset col = col + 1>
<cfset totalcol = totalcol + 1>
</cfif>
<cfif col MOD 4 EQ 1 OR totalcol EQ photodirectory.recordcount>
</tr>
</cfif>
</cfoutput>
</tbody>
</table>
</body>
</html>