vvvmax / unitegallery

Unite Gallery - Responsive jQuery Image and Video Gallery Plugin. Aim to be the best gallery on the web on it's kind. See demo here:
http://unitegallery.net
MIT License
531 stars 158 forks source link

How to get currently displayed image #152

Open tdolph opened 7 years ago

tdolph commented 7 years ago

I made custom button inside lightbox that, when clicked, makes ajax call with currently shown image.

The problem is that the active image shuffles between divs with ug-slide2 and ug-slide3 classes. I dont know how to take active image with jquery. Its is not consistent as i initally thought (ug-slide1 for previous, ug-slide2 for current and ug-slide3 for next image) and now the gallery is integarated with my website and i dont know how to do the final part.

I tried to find some character of the div or image inside of it to identify it as active but i did not find it.

Can someone please help me?

tdolph commented 7 years ago

Okay. I tried one more way. I binded a function to an image thumbnail click and image change api event to check the index of image and check if it is odd number or not. That way i could match the right ug-slide class to an active image. Index 1 is ug-slide2 and 2 is ug-slide3 and 3 is is ug-slide2 and so on... but i stumbled on another issue.

If you close the lightbox and select the image that is supposed to be on the same div (for example, they both have index that is an odd number) then the div classes will get switched.

Im close to giving up...