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

Multiple galleries in one page #163

Open hermionablack opened 6 years ago

hermionablack commented 6 years ago

Hi, I'm using the basic code to initiate the gallery:

<script type="text/javascript">

jQuery(document).ready(function(){

jQuery("#gallery").unitegallery();
}); 
</script>

I need to have multiple galleries in one page. I know that I have to give each gallery a unique ID but I struggle with the initiating part of the code. Can someone help? Thanks.

IProbablyFoundABug commented 6 years ago

I'm doing it like this:

jQuery(".gallery-class-name").each(
  function() {
     /* do some other stuff here */

     $(this).unitegallery();
  }
);

All my galleries share the same class name

variar commented 6 years ago

Another example is here http://pfadismb.ch/gallery/wolfsstufe, generated by plugin

marciojg commented 6 years ago

Dynamically build your ids

unmick commented 6 years ago

Hello,

On my side, all is well working.... But when i have some links, the second gallery is not well displayed. With the following code, the second gallery it's not displayed   <a href="https://github.com/vvvmax/unitegallery/issues/163">   <img alt="Image 1" src="aniceimage.jpg"   data-image="aniceimage.jpg"   data-description="Image 1" >

 If i erase the href, <a href="https://github.com/vvvmax/unitegallery/issues/163"> , all is ok

If you have any idea how to fix this .... Many thanks