jQuery(window).on('load', function(){
var $owl = jQuery('.featured-slider .owl-carousel');
// Check if carousel exists
if ($owl.length === 0) {
console.log("Slider not found. Possibly DOM delayed or plugin interference.");
return;
}
// Check if Owl Carousel is initialized
if (!$owl.hasClass('owl-loaded')) {
console.log("Owl Carousel not initialized yet. Possible JS delay or plugin conflict.");
return;
}
console.log("Owl Carousel detected and initialized.");
// Attempt to trigger autoplay
try {
$owl.trigger('play.owl.autoplay', [3000]);
console.log("Autoplay trigger executed.");
} catch (e) {
console.error("Autoplay failed:", e);
}
});