Your Cart

Setting showCounter to False While Galleria is Running Does Not Remove Counter

These forums are now closed to new replies / tickets.

Please open a support ticket from our new Support page.

Front Page Forums Problems Setting showCounter to False While Galleria is Running Does Not Remove Counter

  • gravatar
    David B. Bitton
    June 11, 2015 at 5:33 pm

    If I call gallery.setIOptions("showCounter", true)
    after the Galleria has started, the counter isn’t removed. I do not
    have the ability to affect the settings prior to load. I am making
    these changes from outside of an iframe. I am able to interact with
    the gallery, just not when it comes to removing the counter. I even
    tried this in Galleria.ready(…) but that didn’t work either. Is
    there an event that fires prior to running where I can make these
    changes, or is there a refresh (or more to the point, re-run)
    method? Thanks!


    gravatar
    David B. Bitton
    June 11, 2015 at 6:33 pm

    OK, I was able to get this to work inside my iframe.load
    event:

    frames[0].window.Galleria.run('#galleria', {responsive: true, debug: false, showCounter: false, showImagenav: false});
    

    This does restart the Galleria with my additional properties. Is
    this the right way?


    gravatar
    David B. Bitton
    June 12, 2015 at 6:08 pm

    I wanted to add some additional findings. The above code works
    in the Javascript console, but in my script, the gallery produces
    “Gallery could not load.” Perhaps a timing issue?


    gravatar
    David B. Bitton
    June 12, 2015 at 6:33 pm

    OK. I “solved” my problem. Looks like ready was being called
    recursively. I now only re-run the galleria when the image count is
    visible.

    jQuery(function(){
        /** hide slideshow and imagenav  counter */
        jQuery(".galleria-iframe").load(function() {
            var w = this.contentWindow;
            w.Galleria.ready(function(){
                var showCounter = this.getOptions("showCounter");
                if(showCounter) {
                    w.Galleria.run('#galleria', {responsive: true, debug: false, showCounter: false, showImagenav: false});
                }
            });
        });
    });
    


Galleria.io uses cookies to store information. You can read more about that in our Privacy Policy. I understand