Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I automatically toggle showinfo in jQuery Galleria plugin?

I can't seem to find this documented anywhere. Basically I just want to have the caption automatically be displayed throughout the slideshow...

Thanks in advance...

like image 374
Logan Watts Avatar asked Dec 16 '22 12:12

Logan Watts


2 Answers

Assuming you are using the Classic theme:

$('#gallery').galleria({
    _toggleInfo: false
});

http://galleria.aino.se/docs/1.2/themes/classic/

like image 194
David Hellsing Avatar answered Dec 24 '22 13:12

David Hellsing


I wanted to have the caption displayed automatically when the galleria is loaded, but not switch of the toggle button which can hide the caption again. (I am not sure though if this was what Logan wanted).

The solution proposed by rodbot seemed to be what what I was looking for.

But just to complete his proposal - do not forget to ensure, that you trigger the click AFTER the galleria is loaded. As documented on http://galleria.aino.se/docs/1.2/references/extending/ - to do that, you must place the clicking logic inside "extend: function(options)". I am also using more "fancier" Galleria.get(0).$('info-link') to get the element.

Complete example:

$("#gallery").galleria({
    width: 661,
    height: 661,
    extend: function(options) {
        Galleria.get(0).$('info-link').click();
    }
});

Just placing the "$(".galleria-info-link").click()" after the script with galleria loading did not work for me, because the element for displaying the caption (which we want to click) is not yet created.

Hopefully this can save someone a few minutes of googling which I needed to find this solution :-)

like image 21
Michal Aron Avatar answered Dec 24 '22 14:12

Michal Aron