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?
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');
});
Thanks, but this does also not work.
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');