473,396 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Add lightbox to query string?

49
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:
Expand|Select|Wrap|Line Numbers
  1. <a href="stairs.jpg" rel="lightbox">text</a>
Even though this is a text example of course.


here is the code for the page:

Expand|Select|Wrap|Line Numbers
  1. <%
  2. If IsArray(varImageAry) Then
  3.     lngMaxIndex = UBound(varImageAry, 2)
  4.     Response.Write("<TABLE>")
  5.     For lngIndex = 0 To lngMaxIndex
  6.         lngImageID = varImageAry(0, lngIndex)
  7.         strTitle = varImageAry(1, lngIndex)
  8.         strDescription = varImageAry(2, lngIndex)
  9.  
  10.         If Not Len(strTitle) = 0 Then strTitle = Server.HTMLEncode(strTitle)
  11.         If Not Len(strDescription) = 0 Then strDescription = Server.HTMLEncode(strDescription)
  12.         Response.Write("<TR>")
  13.         Response.Write("<TD valign=""top"">")
  14.         Response.Write("<IMG src=""image.asp?ImageID=" & lngImageID & """ width=""100"" border=""1"">")
  15.         Response.Write("</TD>")
  16.         Response.Write("<TD valign=""top"">")
  17.         Response.Write("<A href=""image.asp?ImageID=" & lngImageID & """><B>" & strTitle & "</B></A><BR>")
  18.         Response.Write(strDescription)
  19.         Response.Write("</TD>")
  20.         Response.Write("</TR>")
  21.  
  22.     Next
  23.  
  24.     Response.Write("</TABLE>")
  25. Else
  26.     Response.Write("No images are present in this category.")
  27. End If
  28. %>
Anyone have any suggestions where to add my rel="lightbox" to the query?
Jun 23 '09 #1
2 3278
Frinavale
9,735 Expert Mod 8TB
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:
Expand|Select|Wrap|Line Numbers
  1. <%
  2. If IsArray(varImageAry) Then
  3.     lngMaxIndex = UBound(varImageAry, 2)
  4.     Response.Write("<TABLE>")
  5.     For lngIndex = 0 To lngMaxIndex
  6.         lngImageID = varImageAry(0, lngIndex)
  7.         strTitle = varImageAry(1, lngIndex)
  8.         strDescription = varImageAry(2, lngIndex)
  9.  
  10.         If Not Len(strTitle) = 0 Then strTitle = Server.HTMLEncode(strTitle)
  11.         If Not Len(strDescription) = 0 Then strDescription = Server.HTMLEncode(strDescription)
  12.         Response.Write("<TR>")
  13.         Response.Write("<TD valign=""top"">")
  14.         Response.Write("<IMG src=""image.asp?ImageID=" & lngImageID & """ width=""100"" border=""1"">")
  15.         Response.Write("</TD>")
  16.         Response.Write("<TD valign=""top"">")
  17.  
  18.  
  19.         Response.Write("<A href=""image.asp?ImageID=" & lngImageID & """   rel= """ & "lightbox[groupName]""" & "><B>" & strTitle & "</B></A><BR>")
  20.  
  21.  
  22.         Response.Write(strDescription)
  23.         Response.Write("</TD>")
  24.         Response.Write("</TR>")
  25.  
  26.     Next
  27.  
  28.     Response.Write("</TABLE>")
  29. Else
  30.     Response.Write("No images are present in this category.")
  31. End If
  32. %>

-Frinny
Jun 25 '09 #2
jrod11
49
Great, thanks for the response! I'll give it a shot and see how it works.
Jun 25 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: NoWhereMan | last post by:
Hi everybody, first of all, let me say I'm not really a javascript (more a php) guy. Now, I'm trying to integrate lightbox V1 into my project http://flatpress.sf.net I chose V1 because it...
1
by: bordagen | last post by:
Hi all, Is it possible to print the current active image only using Lightbox, without printing the rest of the page content? Cheers
3
by: Bouzy | last post by:
I have been trying to put lightbox on my site I am making, but its not working. I have searched on forums and can't find exactly the same problem. When I click on my thumnail to open it abosolutly...
1
by: daniel | last post by:
Hello, I have limited understanding of js (css/html is more me) and when I run into complicated problems I am left undone. The person I normally call upon is on holiday so I was wondering if I...
1
by: metaphysics | last post by:
I'm attempting to create a slideshow with similar functionality as Lightbox 2. I don't want anything to pop up like the Lightbox does, I just want the slideshow to have next/previous buttons (like...
0
by: FFMG | last post by:
Hi, I want to add a link around images to add the lighbox JS. (http://www.huddletogether.com/projects/lightbox/) I need to look for <img ... /and wrap a <a href=... around it. But the regex...
3
by: truezplaya | last post by:
Hey I am currently creating a mash up that displays the location of some football grounds using a geoRSS feed. I was hoping to add lightbox to my mash up so i can display photos. The...
8
by: vanald04 | last post by:
Alright, I racked my brain all last night and can't figure out what I'm doing wrong. I've copied: <script type="text/javascript" src="js/prototype.js"></script> <script type="text/javascript"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.