School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,367 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,439 people online right now. Registration is fast and FREE... Join Now!




CFWindow open

 

CFWindow open, Opening a CFWindow with an image file in it

xheartonfire43x

11 Jun, 2009 - 10:11 AM
Post #1

D.I.C Regular
***

Joined: 22 Dec, 2008
Posts: 260



Thanked: 2 times
My Contributions
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>


User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 08:47PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month