0

I have set up my first Galleria gallery using JSON.

Would it be possible to add another function to the on click event for each of the four links I have for my four images?

Is there a way to add another variable to the JSON data or assign a class to each individual image?

The analytics my CMS uses has to be called via an on click function so this is essential on my site.

Many thanks, H

Helena85
  • 1
  • 1

2 Answers2

0

Would it be possible to add another function to the on click event for each of the four links I have for my four images?

Yes, you can bind any amount of handlers to the same event. Just do (as usual):

$("selector").click(function(){
   //your code here
});

Is there a way to add another variable to the JSON data or assign a class to each individual image?

I don't know how Galleria's json structure, but if you have the selector, you can add a class (as usual) as:

$("image_selector").addClass("className");

Sorry if some things seemed obvious to you. Hope this helps.

Edgar Villegas Alvarado
  • 18,204
  • 2
  • 42
  • 61
0

Yes, you can add more variables to Galleria's JSON structure. I have successfully added a property called "video" for every object to stream M-JPG when the picture loads.

defvol
  • 14,392
  • 2
  • 22
  • 32