• Resolved Giancarlo Mosso

    (@gmosso)


    Hi,
    in some of the sites I developed I use your plugin (version 1.3.5.9) under tabs. This is an example:
    http://www.lefatedizucchero.com/torte/torte-decorate-pasta-di-zucchero-compleanno-torino/
    When the user clicks a tab, the Javascript event handler (you can find it embedded in the page) triggers the event “smartresize” to force gallery layout rendering:
    $(window).trigger("smartresize");
    Without triggering this event the gallery is not displayed correctly.
    This works well with plugin versions 1.3.x.
    But it does not work anymore with the new 1.5.x series.
    What event do I have to trigger to have the same functionality in 1.5.x version ?
    I would like to continue using your plugin because I find it very good.
    Thanks in advance.
    Best Regards

    https://ww.wp.xz.cn/plugins/envira-gallery-lite/

Viewing 4 replies - 1 through 4 (of 4 total)
  • What about trying just $(window).trigger('resize');?

    Thread Starter Giancarlo Mosso

    (@gmosso)

    Hello Thomas,
    thank you for your reply.
    I had already tried triggering the resize event, I tried again to confirm and unfortunately it does not work.
    The resize event is fired (e.g. if a attach an event handler that logs a string I can see the string logged in the console).
    But it does not force layout rendering. Instead if I resize manually the window the layout is rendered correctly.
    That is why in the 1.3.x version I had used the “smartresize” event, but in this version it does not work anymore.
    If I don’t find a solution I’ll have to stay on version 1.3.x or use a different plugin.
    Giancarlo

    I researched it a little bit more. It looks like with isotope v3 (which is the library we use for resizing), they removed the smartresize function/event. Let me see if I can dig in and find a different way to make this happen.

    Thread Starter Giancarlo Mosso

    (@gmosso)

    Hi Thomas,
    by digging into the code of your plugin I found the solution. I’ll share here in the hope it could be useful to someone else.
    The call to be done is:
    envira_isotopes[<galleryNumber>].enviratope('layout');
    envira_isotopes is an array defined by your plugin, so this solution will work as long as you don’t rename that variable, in case I’ll fix my code.
    In any case thank you for your support and willing to solve my problem.
    Giancarlo

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Javascript event to trigger gallery layout render’ is closed to new replies.