Hello, not strong in jquery, I use the fanboxbox plugin + zoom increase, the question is how to make this plugin work considering that there can be several such galleries on the page that are generated through the cycle and there can be 15 and 20 galleries,
- what is the actual problem? Did you try to just add a second gallery? it seems to me that there is no jsfiddle.net/oceog/hbUh8/2 - zb '22
- Of course I tried, and you checked what happened? :) Click on it, you will understand. - dogmar
- elevateweb.co.uk/image-zoom/examples here are a few galleries, see how it's done. I think they change id. - zb '22
- they have there in numerical order from # zoom_1 to # zoom_10, a script is registered for each gallery, and for me they will be generated in a cycle in an unknown number, is it possible to make a script one universal which will support many galleries? - dogmar
|
1 answer
we go through all the .zoom_03, we take the gallery as next (), apparently this is a restriction of the plug-in that it is necessary to insert the id there, otherwise it would be nice to make it beautifully (without generating the id to the gallery when generating the page)
$(document).ready(function () { $(".zoom_03").each(function () { var $this = $(this); var galery = $this.next().attr('id'); $this.elevateZoom({ gallery: galery, cursor: 'pointer' }) }); $(".zoom_03").bind("click", function (e) { var ez = $(this).data('elevateZoom'); $.fancybox(ez.getGalleryList()); return false; }); });
|