cbeyls / slimbox

The ultimate lightweight Lightbox clone
http://www.digitalia.be/software/slimbox2
50 stars 24 forks source link

Remove duplicate links to images #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Link to the same image using the same lightbox-group in the rel attribute
2. Click on the thumbnail and it pops up the same image multiple times.

What is the expected output? What do you see instead?
Duplicate links should be consolidated.

What version of the product are you using? On what operating system?
slimbox2 - jquery

Please provide any additional information below.

Original issue reported on code.google.com by oisze....@gmail.com on 30 Jun 2009 at 8:26

GoogleCodeExporter commented 9 years ago
This is not a defect but a feature request. In the first versions of Slimbox,
duplicates were removed. Then people complained so I changed it so that images 
are
just kept untouched which I think is the expected behavior.

It's your responsibility to filter out the duplicates first. For example, 
create a
group containing all the images that you want, in the order that you want. If 
you
want to create an additional link to an already linked image, you can add a 
snippet
of javascript code that will mimic a click on the first link when clicking on 
the
second one, like this:

jQuery(function($) {
   $("#secondlink").click(function() {
      $("#firstlink").click();
      return false;
   });
});

You can also open the box directly using the Slimbox API, or define a linkMapper
function which removes specific elements from the group that you know are 
duplicates.

Original comment by christophe.beyls@gmail.com on 20 Aug 2009 at 12:31