JVRudnick
02-04-2003, 04:20 PM
Hello all...
wondering the following. I've created an ASP handler that will poll a folder, find the names of all the .jpgs therein, then display same in a photo gallery, no problems so far.
the thing is, now, I want to make those little thumbnails open up at a set size in a new window, once selected by the user.
here's the code I'm using....
<%@ LANGUAGE ="VBSCRIPT" %>
<% Option Explicit %>
<%Response.Buffer = True%>
<!-- NEW JAVASCRIPT WINDOWS FUNCTION HERE -------------- -->
<script language=Javascript type="text/Javascript">
function newWindow(fishStory) {
fishWindow = window.open(fishStory, 'fishWin', 'toolbar=no, location=no, scrollbars=no, width=300, height=220, top=80, left=120')
fishWindow.focus()
}
</script>
<%
'--------------------------------------------------------------------------------
'------- handler to find the # of pix in a folder, then display them in a table and provide
'------- a javascript handler to pop up a new window holding the selected photo -------
Dim fs, f, fc, f1, fileName, filePath, name
%>
<DIV style="position:absolute;left:20;top:50;width:500;height:1000;z-index:3;visibility:visible;">
<%
name = "images/pix"
' name and path to the photo folder...
filePath = server.mappath(name)
' must find the file and it's path for following routine...
set fs = CreateObject("Scripting.FileSystemObject")
set f = fs.GetFolder(filePath)
set fc= f.files
' create the object to grab the pix....
%>
<table>
<%
For each f1 in fc
' loop thru contents of whole folder...
fileName = (f1.name)
' get the name of each .jpg in that folder
%>
<tr><td>
<a href="javascript:newWindow('<%=fileName%>')">
<img src="images/pix/<%=fileName%>" width="80" border="0">
</a>
</td></tr>
<%
Next
SET f1 = Nothing
' housekeeping here
%>
</table>
</div>
what happens is that the new window does open -- but without the .jpg inside....
I suspect that my function is not correct --- that is, it requires that I use an .html page that will fill the new window...but I dont' want to do that (create a sep html page for each of the dang .jpgs)
what I want is just to show the .jpg in that window.
so the question is, can someone here look at my javascript window function and point out what I've got to do to accomplish that?
Jim
wondering the following. I've created an ASP handler that will poll a folder, find the names of all the .jpgs therein, then display same in a photo gallery, no problems so far.
the thing is, now, I want to make those little thumbnails open up at a set size in a new window, once selected by the user.
here's the code I'm using....
<%@ LANGUAGE ="VBSCRIPT" %>
<% Option Explicit %>
<%Response.Buffer = True%>
<!-- NEW JAVASCRIPT WINDOWS FUNCTION HERE -------------- -->
<script language=Javascript type="text/Javascript">
function newWindow(fishStory) {
fishWindow = window.open(fishStory, 'fishWin', 'toolbar=no, location=no, scrollbars=no, width=300, height=220, top=80, left=120')
fishWindow.focus()
}
</script>
<%
'--------------------------------------------------------------------------------
'------- handler to find the # of pix in a folder, then display them in a table and provide
'------- a javascript handler to pop up a new window holding the selected photo -------
Dim fs, f, fc, f1, fileName, filePath, name
%>
<DIV style="position:absolute;left:20;top:50;width:500;height:1000;z-index:3;visibility:visible;">
<%
name = "images/pix"
' name and path to the photo folder...
filePath = server.mappath(name)
' must find the file and it's path for following routine...
set fs = CreateObject("Scripting.FileSystemObject")
set f = fs.GetFolder(filePath)
set fc= f.files
' create the object to grab the pix....
%>
<table>
<%
For each f1 in fc
' loop thru contents of whole folder...
fileName = (f1.name)
' get the name of each .jpg in that folder
%>
<tr><td>
<a href="javascript:newWindow('<%=fileName%>')">
<img src="images/pix/<%=fileName%>" width="80" border="0">
</a>
</td></tr>
<%
Next
SET f1 = Nothing
' housekeeping here
%>
</table>
</div>
what happens is that the new window does open -- but without the .jpg inside....
I suspect that my function is not correct --- that is, it requires that I use an .html page that will fill the new window...but I dont' want to do that (create a sep html page for each of the dang .jpgs)
what I want is just to show the .jpg in that window.
so the question is, can someone here look at my javascript window function and point out what I've got to do to accomplish that?
Jim