11
/* Ensure widget and caption get correct classes / stacking so overlay + lightbox work - Code by LEMON SHLIF */ jQuery(document).ready(function($){ $('.elementor-widget-image, .elementor-image').each(function(){ var $w = $(this); var $caption = $w.find('.elementor-image-caption, figcaption, .caption'); // ensure container positioned (safe-guard if CSS not applied) $w.css('position','relative'); if($caption.length){ $caption.addClass('lmn-overlay-caption'); } // ensure link that wraps the image is positioned under overlay (so clicks reach it) var $linkWithImg = $w.find('a').has('img'); if($linkWithImg.length){ $linkWithImg.css({ 'display':'block', 'position':'relative', 'z-index':'0' }); } }); });
11