Solved

Help with lightbox

Posted on 2012-04-11
4
186 Views
Last Modified: 2012-06-12
I am fairly new to html and very new to jquery/lightbox.  I desire to do the following.  I want a hyperlink that opens a lightbox gallery that shows several photos.

My code so far looks like this:
<html>
	<head>
		<link rel="stylesheet" type="text/css" href="css/jquery.lightbox-0.5.css" media="screen" />
	
		<script type="text/javascript" src="js/jquery.js"></script>
		<script type="text/javascript" src="js/jquery.lightbox-0.5.js"></script>
		<script type="text/javascript">
			$(function() {
				$('#gallery a').lightBox();
			});
		</script>		
	</head>
	<body>
		<div id="gallery">  
			<a href="photos/image1.jpg" >Picture 1</a>
			<br/>
			<a href="photos/image2.jpg" >Picture 2</a>
		</div>
	</body>
</html>

Open in new window


I would like to show both pictures (or more) but with only one link.  Any ideas?
0
Comment
Question by:randys106
  • 2
4 Comments
 
LVL 12

Expert Comment

by:Anuradha Goli
Comment Utility
I can present you a logic to implement such scenario;
You can place all the images you wanted to show in popup in other html file.
using the Jquery on image click you can popup that HTML.
But instead of light box you need to use, fancybox or other lightbox plugin that dispaly html in popups.
Hope this helps you better.
0
 

Author Comment

by:randys106
Comment Utility
I just found an example of what I want to do but it uses Joomla.  Look here at example 7.  Can I do this in Lightbox or can I mix html and joomla?
0
 
LVL 15

Accepted Solution

by:
Jagadishwor Dulal earned 500 total points
Comment Utility
Yes you can use just add other ids in lightbox
<script type="text/javascript">
			$(function() {
				$('#gallery a').lightBox();
			});
		</script>	

Open in new window


<div id="gallery">  
			<a href="photos/image1.jpg" >Picture 1</a>
			<br/>
			<a href="photos/image2.jpg" >Picture 2</a>
		</div>

Open in new window


Add div like gallery in above
0
 

Author Comment

by:randys106
Comment Utility
Thanks jagadishdulal.  That helped but I am still struggling.  Here is really what I am trying to accomplish.  I want two hyperlinks.  When you click the first one, it opens a lightbox gallery.  when you click the second one it opens a different lightbox gallery.

Thanks in advance.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now