Add lightbox to query string?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jrod11
    New Member
    • Apr 2009
    • 49

    Add lightbox to query string?

    I recently found a gallery (http://www.planet-source-code.com/vb...=6727&lngWId=4). The image in the gallery when clicked on will open the larger image in the same window. I want to replace it with light box. I have added the lightbox javascript, but I'm no sure where to place the light box call.

    To call the lightbox, i have to add this:
    Code:
    <a href="stairs.jpg" rel="lightbox">text</a>
    Even though this is a text example of course.


    here is the code for the page:

    Code:
    <%
    If IsArray(varImageAry) Then
    	lngMaxIndex = UBound(varImageAry, 2)
    	Response.Write("<TABLE>")
    	For lngIndex = 0 To lngMaxIndex
    		lngImageID = varImageAry(0, lngIndex)
    		strTitle = varImageAry(1, lngIndex)
    		strDescription = varImageAry(2, lngIndex)
    		
    		If Not Len(strTitle) = 0 Then strTitle = Server.HTMLEncode(strTitle)
    		If Not Len(strDescription) = 0 Then strDescription = Server.HTMLEncode(strDescription)
    		Response.Write("<TR>")
    		Response.Write("<TD valign=""top"">")
    		Response.Write("<IMG src=""image.asp?ImageID=" & lngImageID & """ width=""100"" border=""1"">")
    		Response.Write("</TD>")
    		Response.Write("<TD valign=""top"">")
    		Response.Write("<A href=""image.asp?ImageID=" & lngImageID & """><B>" & strTitle & "</B></A><BR>")
    		Response.Write(strDescription)
    		Response.Write("</TD>")
    		Response.Write("</TR>")
    		
    	Next
    	
    	Response.Write("</TABLE>")
    Else
    	Response.Write("No images are present in this category.")
    End If
    %>
    Anyone have any suggestions where to add my rel="lightbox" to the query?
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    I've never used LightBox before but it looks amazing!
    I'm going to look into using it when I update one of my web applications.
    :)

    Here's a link to the Official Lightbox website.

    According to that website you add the "rel" attribute to the hyperlink that opens the image.

    I might be wrong here but, in your example I think you'd add it as follows:
    Code:
    <%
    If IsArray(varImageAry) Then
        lngMaxIndex = UBound(varImageAry, 2)
        Response.Write("<TABLE>")
        For lngIndex = 0 To lngMaxIndex
            lngImageID = varImageAry(0, lngIndex)
            strTitle = varImageAry(1, lngIndex)
            strDescription = varImageAry(2, lngIndex)
     
            If Not Len(strTitle) = 0 Then strTitle = Server.HTMLEncode(strTitle)
            If Not Len(strDescription) = 0 Then strDescription = Server.HTMLEncode(strDescription)
            Response.Write("<TR>")
            Response.Write("<TD valign=""top"">")
            Response.Write("<IMG src=""image.asp?ImageID=" & lngImageID & """ width=""100"" border=""1"">")
            Response.Write("</TD>")
            Response.Write("<TD valign=""top"">")
    
    
            Response.Write("<A href=""image.asp?ImageID=" & lngImageID & """   rel= """ & "lightbox[groupName]""" & "><B>" & strTitle & "</B></A><BR>")
    
    
            Response.Write(strDescription)
            Response.Write("</TD>")
            Response.Write("</TR>")
     
        Next
     
        Response.Write("</TABLE>")
    Else
        Response.Write("No images are present in this category.")
    End If
    %>

    -Frinny

    Comment

    • jrod11
      New Member
      • Apr 2009
      • 49

      #3
      Great, thanks for the response! I'll give it a shot and see how it works.

      Comment

      Working...