Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1487152

    Hi,

    we have an Instagram feed on our website and clicking on those images also opens the Enfold lightbox (URL added in the private content section).

    While we still need the lightbox for other pages, we’d like to disable it specifically for these elements.
    We tried this code, as it was suggested on other threads here:

    jQuery(document).ready(function() {
    	jQuery('.sbi_link_area').addClass('noLightbox');
    });

    But even though the class is added properly, it does not remove the lightbox (maybe because it is initiated before we add the class).

    What else could we try?

    #1487157

    maybe it is best to give the class to one of its parents ( not the anchor element itself)

    f.e.:

    jQuery(document).ready(function() {
    	jQuery('.sbi_link').addClass('noLightbox');
    });
    #1487159

    Thanks, but this does also not work.

    #1487160

    can you see in DOM that those classes are added?
    how did you insert your snippet ot wordpress?

    f.e. in child-theme functions.php:
    btw. you place your sbi shortcode to your content – why don’t you give the parent element (f.e. color-section a custom class: noLightbox ) – i did it that way !

    function add_noLightbox_class_to_sbi_link(){
    ?>
    <script>
    window.addEventListener("DOMContentLoaded", function () { 
      (function($){
          $('.sbi_link').addClass('noLightbox');
      })(jQuery);
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_noLightbox_class_to_sbi_link');
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.