Take your website
To the next level
Discover our newly launched customization services and elevate your web projects to new heights.
Delegate tasks, save time, and unlock the power of professional WordPress outsourcing.

Okay
  Public Ticket #1602859
Is my theme deferring js?
Closed

Comments

  • Jemma started the conversation

    I have Envira Gallery installed on my site and it is conflicting with TheGem child theme that I have installed. 

    The Envira Gallery thumbnails and slideshow buttons are not working as expected. The Envira support team have copied my site to a staging site, deleted the cache, deactivated all the plugins, set the Twenty Seventeen theme on the site, and they found then that the Envira Gallery was working properly. They reactivated all the plugins and the Gallery was still working. Then they reactivated TheGem child theme and the Gallery stopped working. The tech who's been helping me says that she thinks the only thing it could be is that the theme is "deferring js". She says that the theme needs to be "calling the scripts in the footer".

    Can you tell me if that's the case and how I can fix it so that I can get the plugin working with TheGem child theme?

  • [deleted] replied

    Hi,

    Where I can see problem? And please give more info about it with some screenshots.

  • Jemma replied

    Hi Max,

    If you go here: https://icefeatherwind.com.au/benny-30th-birthday-dinner/

    Click on a photo in the gallery shown in 1.png.

    You'll see lightbox as shown in 2.png.

    The issues are:

    - thumbnails should display along the bottom of the window, not the side.

    - white background behind the thumbnails should be transparent.

    - play button arrow (top right) should play a slideshow of the images; it does nothing.

    - thumbnail boxes (top right) should toggle the thumbnails on and off; it does nothing.

    So, when I contacted Envira about this (see my first msg about how they troubleshooted it), they said that it is because TheGem child theme is "deferring js" and that I should contact you guys to see what I can do to fix it.


  • [deleted] replied

    Please share admin access. I will check plugin configuration.

  •   Jemma replied privately
  • [deleted] replied

    Hi,

    I inspected plugin. In our theme we use fancybox script to show popups in galleries, portfolios and other places.  Envira gallery srcript is a copy of fancybox script with renamed classes and functions. But not all functions are renamed. Therefore you have conflict with theme and plugins.

    For example I see next code in fancybox script:

        $(document).on({
            'onInit.fb' : function(e, instance) {
                if ( instance && !instance.Thumbs ) {
                    instance.Thumbs = new FancyThumbs( instance );
                }
            },         'beforeShow.fb' : function(e, instance, item, firstRun) {

    And this script in envira-gallery/assets/js/lib/envirabox-thumbs.js file:

        $(document).on({
            'onInit.fb' : function(e, instance) {
                if ( instance && !instance.Thumbs ) {
                    instance.Thumbs = new FancyThumbs( instance );
                }
            },         'beforeShow.fb' : function(e, instance, item, firstRun) {
    Envira gallery use fancybox events. This is the cause of the conflict. Envira developers must use onInit.eb and beforeShow.eb names for events to prevent conflict.

  • Jemma replied

    Thanks Max, I have passed on your findings to Envira and they are working on a fix. Thank you!