1

I have create a little fotogallery where I display only the first 3 images, the first "big" on the left side and the other two (small, width / 2 of the big one) on the right side. All images are "linked" to colorbox. If I click on one of these 3 images colorbox "run" (ok, perfect).

Via a div in a absolute position style I have added this phrase "See all NUMBER images". Now I need to link this "phrase" to the event that run colorbox from the first image (the big).

How can i do this ?

1 Answer 1

2

This can be achieved with jQuery .trigger() event.

jQuery('#id-of-your-phrase').click(function (e) {
 e.preventDefault();
 jQuery('#id-or-class-of-first-image-YouCanAlsoUse-first-child').trigger('click');
});

This code will open the colorbox from First Image (the Big).

1
  • Oh My god! So simple ? Why ??? Thanks and again thanks.
    – ZioBudda
    Commented Dec 4, 2015 at 16:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.