(function($){
$( ".gallery-item" ).on( "click", function() {
$( ".elementor-slideshow__title" ).trigger( "click" );
$( ".elementor-slideshow__title" ).on( "click", function() {
// Replace '-' with an actual
DOM element
$(this).contents().filter(function() {
return this.nodeType === 3 && this.nodeValue.includes('-'); // Find text nodes containing '-'
}).each(function() {
var parts = this.nodeValue.split('-');
this.nodeValue = parts.shift(); // Replace the text before '-'
parts.forEach(function(part) {
$(this).after(document.createElement('br'), part); // Insert
and then the remaining text
}.bind(this));
});
});
elementorFrontend.hooks.addAction( 'elementor/frontend/init', function() { // Similar replacement in the elementorFrontend init $( ".elementor-slideshow__title" ).contents().filter(function() { return this.nodeType === 3 && this.nodeValue.includes('-'); }).each(function() { var parts = this.nodeValue.split('-'); this.nodeValue = parts.shift(); parts.forEach(function(part) { $(this).after(document.createElement('br'), part); }.bind(this)); }); });
});
})(jQuery);
if (document.querySelector('.elementor-lightbox .swiper-container, .elementor-lightbox .swiper') && document.querySelector('.elementor-lightbox .swiper-container, .elementor-lightbox .swiper').swiper) { let swiperCont = document.querySelector('.elementor-lightbox .swiper-container, .elementor-lightbox .swiper'); let swiperInstance = swiperCont.swiper;
function updateCaptions() { let imageElem = swiperCont.querySelector('.swiper-slide-active img'); let titleText = imageElem.getAttribute('data-title'); let descriptionText = imageElem.getAttribute('data-description'); let titleElem = swiperCont.querySelector('.elementor-slideshow__title'); let descriptionElem = swiperCont.querySelector('.elementor-slideshow__description');
titleElem.innerHTML = titleText; descriptionElem.innerHTML = descriptionText; } updateCaptions();
swiperInstance.on('slideChangeTransitionEnd', function () { updateCaptions(); }); } }, 200); });
// $('.elementor-slideshow__title').each(function() {
// jQuery('.elementor-slideshow__title').html((i, v) => v.replace(',', '
'));
// });