click a button - jquery

in my page have a jquery lightbox, colorbox.

So it plays a slideshow and we can group pictures using "rel". So i have group of images and images have links to high res images, these images have the same "rel" and when click on an image slideshow starts.

But the problem is slideshow only starts if user click on a small image which has the <a rel="group">

I want to start the slideshow from a separate button. so what I did is I set something like this.

											slideshowAuto: true,
											maxWidth: '80%',
											initialWidth: '80%',
											scalePhotos: true

Open in new window

So I've configured the lightbox with a slideshow and the button is "albumSlideshow" so when user click that button a[rel='albumSlideshow]' also get clicked, the problem is page has lots of a[rel='albumSlideshow] so it screws up the slideshow.

What I wants to do is, click only one a[rel='albumSlideshow]. Well I can assign an ID to one of this links and set it to be clicked, but this is a dynamic site.

Hope it make sence

<a rel="group" href="real_img.jpg">Small image here</a>
Who is Participating?
jhp333Connect With a Mentor Commented:
Or if the <a> is one of the follow siblings of the button:

You need to find a relationship between the button and the <a>.
For example, if the button and <a> are siblings, i.e. have a common direct parent, you can do:


Or if they have a common ancestor div, you can do:

Using jQuery it's fairly easy. You would use the trigger() method. E.g.


And that will trigger the javascript in the Click event.
sahanzAuthor Commented:
Thanks a lot,
Tried this

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.