//Hide Save For Later For Unknown User $.ajax({ type: "Post", url: "/api/sitecore/CFS/HasDisplayLeadForm", success: function (data) { if (data && data == true) { $('.save-for-later').hide(); } else { $('.save-for-later').show(); } }, Error: function (data) { console.log("Server Error in HasDisplayLeadForm to display Save For Later Link"); } }); $(window).on('load resize', function () { const listPlansStrLtrl = ".list-plans"; var width = $(this).width(); if(width < 768){ $(listPlansStrLtrl).slick({ dots: true, responsive: [{ settings: { slidesToShow: 1 } }] }); } else if (width >= 768 && $(listPlansStrLtrl).hasClass("slick-slider")) { $(listPlansStrLtrl).slick('unslick'); } }); function initCarousels() { if (!$.fn.slick) return; var bannerCarousel = $("#banner-carousel"); var protectionPlansCarousel = $("#all-plans-carousel-generic:not(.kitfhelp-carousel)"); var currentProtectionPlan = $(".protection-plan-name"); if (typeof currentProtectionPlan !== "undefined") { var protectionPlanName = currentProtectionPlan.text().toLowerCase().replace(/ /g, "-"); if (protectionPlanName === 'autonation-vehicle-protection-plan') { $("#autonation-vehicle-care-program").addClass("active"); } $("#" + protectionPlanName).remove(); $(".carousel-indicators li:last-child").remove(); } bannerCarousel.slick({ dots: true, infinite: true, autoplay: true }); bannerCarousel.css("visibility", "visible"); if( protectionPlansCarousel.length > 0 ){ protectionPlansCarousel.slick({ dots: true, infinite: true, autoplay: true, autoplaySpeed: 2000, slidesToShow: 3, slidesToScroll: 1, responsive: [ { breakpoint: 769, settings: { slidesToShow: 2 } }, { breakpoint: 426, settings: { slidesToShow: 1 } } ] }); } } //$(function () { initCarousels(); //});