function waitForSwiperInstance(selector, callback, timeout = 5000) {
const start = Date.now();
const interval = setInterval(() => {
const el = document.querySelector(selector);
if (!el) return;
const swiper = el.swiper || (window.jQuery && jQuery(el).data('swiper'));
if (swiper) {
clearInterval(interval);
callback(swiper);
}
if (Date.now() - start > timeout) {
clearInterval(interval);
}
}, 100);
}
document.addEventListener('DOMContentLoaded', function () {
waitForSwiperInstance('#my-carousel .elementor-image-carousel-wrapper', function (swiperInstance) {
// Handle clicks on dynamic images
document.querySelectorAll('.jet-listing-dynamic-image__link').forEach(link => {
link.addEventListener('click', function () {
const img = this.querySelector('img');
const altText = img?.getAttribute('alt')?.trim()?.toLowerCase();
if (!altText) return;
const slides = swiperInstance.slides;
let matchedIndex = -1;
slides.forEach((slide, index) => {
if (slide.classList.contains('swiper-slide-duplicate')) return;
const caption = slide.querySelector('.elementor-image-carousel-caption');
const captionText = caption?.textContent?.trim()?.toLowerCase();
if (captionText === altText && matchedIndex === -1) {
matchedIndex = index;
}
});
if (matchedIndex !== -1) {
swiperInstance.slideTo(matchedIndex);
}
});
});
// Handle button with show-first-image
document.querySelectorAll('[show-first-image="true"]').forEach(button => {
button.addEventListener('click', function () {
swiperInstance.slideToLoop(0);
});
});
});
});
Test2
Avenida Presidente Masaryk 490, Polanco, Polanco II Sección, Ciudad de México, CDMX
Space Details
Test2 Test2 Test2 Test2
Highlights
Electrical substation
Internal roads
Maneuvering yard
Location
Contact Advertiser
Contact the advertiser for more information about this property.
Explore Similar Industrial Properties
jQuery(document).ready(function() {
jQuery('#go-back').on('click', function() {
window.history.go(-1);
return false;
});
});










