vbscript - How to Display images 100x75, and on click, display them in original size. ASP classic -


the code below first displays folders hyperlinks, can click these folders , if contain jpg's display them.

is possible make these images display attributes width="100" height="75" still allow me click them , have them display original size?

<% const forreading = 1, forwriting = 2, forappending = 3 const tristateusedefault = -2, tristatetrue = -1, tristatefalse = 0  qfolder = request.querystring("f") if qfolder = ""     folderspec = server.mappath(".")     set filesys = createobject("scripting.filesystemobject")      set demofolder = filesys.getfolder(folderspec)      set folcoll = demofolder.subfolders     each subfol in folcoll         folsize = left((subfol.size/1000000), 3)         folist = folist & "<a href='?f=" & subfol.name & "'><strong title='view'></strong> " & subfol.name & "" & vbcrlf         folist = folist & "<br>"       next     set filesys = nothing     response.write folist  else  filepath = server.mappath(".") & "\" & qfolder captionfile = filepath & "\captions.txt" set filesys = createobject("scripting.filesystemobject") dim somearray() 'caption part     if filesys.fileexists(captionfile)         set file = filesys.getfile(captionfile)         set textstream = file.openastextstream(forreading,tristateusedefault)         captioncount = 0         while not textstream.atendofstream             line = textstream.readline             redim preserve somearray(captioncount)             somearray(captioncount) = line             'response.write captioncount & " " & somearray(captioncount) & "<br>"             captioncount = captioncount + 1             'response.write line         loop         textstream.close     end if  'folder part     set demofolder = filesys.getfolder(filepath)      set filecoll = demofolder.files     filecount = 0     each file in filecoll         ext = ucase(right(file.path, 3))          if ext = "jpg" or ext = "gif"         on error resume next         data = somearray(filecount)         on error goto 0         hrefpath = qfolder & "/" & file.name         imagepath = "<strong>" & data & "</strong><br><a href='" & hrefpath & "' title='free image gallery' border=0><img src='" & hrefpath & "' border='" & border_size & "' title=""" & data & """ style='border-color: " & border_color & ";'></a><br>"         filist = filist & imagepath & vbcrlf         filist = filist & "<br>"         filecount = filecount + 1         data = ""         end if     next     set filesys = nothing     filist = filist & "<br><small><a href='http://www.allscoop.com/' target='_blank'>allscoop free image gallery</a></small>" %>  <h3><a href="." title="up 1 level">&#171;</a> &nbsp;<%=qfolder%></h3>  <p><%=filist%></p>  <% end if %> 

thanks

you need update single line tag created:

imagepath = "<strong>" & data & "</strong><br><a href='" & hrefpath & _        "' title='free image gallery' border=0><img width=100 height=75 src='" &_        hrefpath & "' border='" & border_size & "' title=""" & data &_        """ style='border-color: " & border_color & ";'></a><br>" 

just in case here complete script:

<% const forreading = 1, forwriting = 2, forappending = 3 const tristateusedefault = -2, tristatetrue = -1, tristatefalse = 0  qfolder = request.querystring("f") if qfolder = ""     folderspec = server.mappath(".")     set filesys = createobject("scripting.filesystemobject")      set demofolder = filesys.getfolder(folderspec)      set folcoll = demofolder.subfolders     each subfol in folcoll         folsize = left((subfol.size/1000000), 3)         folist = folist & "<a href='?f=" & subfol.name & "'><strong title='view'></strong> " & subfol.name & "" & vbcrlf         folist = folist & "<br>"       next     set filesys = nothing     response.write folist  else  filepath = server.mappath(".") & "\" & qfolder captionfile = filepath & "\captions.txt" set filesys = createobject("scripting.filesystemobject") dim somearray() 'caption part     if filesys.fileexists(captionfile)         set file = filesys.getfile(captionfile)         set textstream = file.openastextstream(forreading,tristateusedefault)         captioncount = 0         while not textstream.atendofstream             line = textstream.readline             redim preserve somearray(captioncount)             somearray(captioncount) = line             'response.write captioncount & " " & somearray(captioncount) & "<br>"             captioncount = captioncount + 1             'response.write line         loop         textstream.close     end if  'folder part     set demofolder = filesys.getfolder(filepath)      set filecoll = demofolder.files     filecount = 0     each file in filecoll         ext = ucase(right(file.path, 3))          if ext = "jpg" or ext = "gif"         on error resume next         data = somearray(filecount)         on error goto 0         hrefpath = qfolder & "/" & file.name         imagepath = "<strong>" & data & "</strong><br><a href='" & hrefpath & "' title='free image gallery' border=0><img width=100 height=75 src='" & hrefpath & "' border='" & border_size & "' title=""" & data & """ style='border-color: " & border_color & ";'></a><br>"         filist = filist & imagepath & vbcrlf         filist = filist & "<br>"         filecount = filecount + 1         data = ""         end if     next     set filesys = nothing     filist = filist & "<br><small><a href='http://www.allscoop.com/' target='_blank'>allscoop free image gallery</a></small>" %>  <h3><a href="." title="up 1 level">&#171;</a> &nbsp;<%=qfolder%></h3>  <p><%=filist%></p>  <% end if %> 

Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -