(function ($) { 'use strict'; jQuery('.mean-menu').meanmenu({ meanScreenWidth: "991" }); jQuery(window).on('load', function () { $('.preloader').fadeOut(); }); $('select').not("#nationality_Select").niceSelect(); $(window).on('scroll', function () { if ($(this).scrollTop() > 150) { $('.navbar-area').addClass("is-sticky"); $('.heder-top-area').addClass("is-sticky"); $('.sidebar-nav-modal').addClass("is-sticky"); } else { $('.navbar-area').removeClass("is-sticky"); $('.heder-top-area').removeClass("is-sticky"); $('.sidebar-nav-modal').removeClass("is-sticky"); } var scrolled = $(window).scrollTop(); if (scrolled > 300) $('.go-top').addClass('active'); if (scrolled < 300) $('.go-top').removeClass('active'); }); $('.eorik-slider').owlCarousel({ loop: true, margin: 0, nav: false, mouseDrag: false, items: 1, dots: true, autoHeight: true, autoplay: true, smartSpeed: 1500, autoplayHoverPause: true, animateOut: "fadeOut", navText: ["", "", ], }); $('.eorik-slider-three').owlCarousel({ loop: true, margin: 0, nav: true, mouseDrag: false, items: 1, dots: false, autoHeight: true, autoplay: true, smartSpeed: 1500, autoplayHoverPause: true, navText: ["", "", ], }); $('.slider-winner').owlCarousel({ items: 1, loop: false, nav: true, autoplay: false, // autoplayHoverPause: true, // mouseDrag: false, // margin: 0, // center: false, dots: false, slideTransition: 'linear', autoplayTimeout: 4500, autoplayHoverPause: true, autoplaySpeed: 4500, navText: ["", "", ], responsive: { 0: { items: 1, }, 576: { items: 2, }, 768: { items: 3, }, 992: { items: 6, }, 1200: { items: 3, }, }, }); // slider-offers-wrap $('.slider-offers-wrap').owlCarousel({ items: 1, loop: false, nav: true, autoplay: false, // autoplayHoverPause: true, // mouseDrag: false, margin: 20, // center: false, dots: false, slideTransition: 'linear', autoplayTimeout: 4500, autoplayHoverPause: true, autoplaySpeed: 4500, navText: ["", "", ], responsive: { 0: { items: 1, }, 576: { items: 2, }, 768: { items: 3, }, 992: { items: 6, }, 1200: { items: 3, }, }, }); $('.eorik-slider-four').owlCarousel({ loop: true, nav: false, thumbs: false, dots: true, thumbsPrerendered: true, autoplayHoverPause: true, autoplay: true, items: 1, animateOut: "fadeOut", }); $('.eorik-slider-five').owlCarousel({ loop: true, nav: true, thumbs: true, dots: false, thumbsPrerendered: true, autoplayHoverPause: true, autoplay: true, items: 1, navText: ["", "", ], }); $('.single-city-item').owlCarousel({ loop: true, margin: 0, nav: true, mouseDrag: true, items: 1, dots: false, autoHeight: true, autoplay: false, smartSpeed: 1500, autoplayHoverPause: true, navText: ["", "", ], }); $('.restaurants-wrap').owlCarousel({ items: 1, loop: true, nav: false, autoplay: true, autoplayHoverPause: true, mouseDrag: true, margin: 0, center: false, dots: false, slideTransition: 'linear', autoplayTimeout: 4500, autoplayHoverPause: true, autoplaySpeed: 4500, responsive: { 0: { items: 1, }, 576: { items: 1, }, 768: { items: 2, }, 992: { items: 2, }, 1200: { items: 3, }, }, }); $('.slider-gallery-wrap-new').owlCarousel({ items: 1, loop: true, nav: true, autoplay: true, autoplayHoverPause: true, mouseDrag: true, margin: 0, center: false, dots: false, slideTransition: 'linear', autoplayTimeout: 4500, autoplayHoverPause: true, autoplaySpeed: 4500, responsive: { 0: { items: 2, }, 576: { items: 2, }, 768: { items: 3, }, 992: { items: 6, }, 1200: { items: 7, }, }, }); $('.slider-gallery-wrap-neww').owlCarousel({ items: 1, loop: true, nav: true, autoplay: false, autoplayHoverPause: true, mouseDrag: false, margin: 0, center: false, dots: false, slideTransition: 'linear', autoplayTimeout: 4500, autoplayHoverPause: true, autoplaySpeed: 4500, responsive: { 0: { items: 2, }, 576: { items: 2, }, 768: { items: 3, }, 992: { items: 6, }, 1200: { items: 7, }, }, }); $('.testimonials-wrap').owlCarousel({ items: 1, loop: true, nav: false, autoplay: true, autoplayHoverPause: true, mouseDrag: true, margin: 30, center: false, dots: false, smartSpeed: 1500, responsive: { 0: { items: 1, }, 576: { items: 1, }, 768: { items: 2, }, 992: { items: 3, }, 1200: { items: 3, }, }, }); $('.exclusive-top-wrap').owlCarousel({ items: 1, loop: true, nav: false, autoplay: true, autoplayHoverPause: true, mouseDrag: true, margin: 30, center: false, dots: false, smartSpeed: 1500, responsive: { 0: { items: 1, }, 576: { items: 1, }, 768: { items: 2, }, 992: { items: 2, }, 1200: { items: 2, }, 1920: { items: 3, }, }, }); $('.customer-wrap').owlCarousel({ loop: true, nav: false, autoplay: true, autoplayHoverPause: true, mouseDrag: true, margin: 30, center: true, dots: true, smartSpeed: 1500, responsive: { 0: { items: 1, }, 576: { items: 1, }, 768: { items: 1, }, 992: { items: 3, }, 1200: { items: 3, }, }, }); $('.customer-wrap-four').owlCarousel({ items: 1, loop: true, nav: true, autoplay: false, autoplayHoverPause: true, mouseDrag: true, margin: 30, center: true, dots: false, smartSpeed: 1500, navText: ["", "", ], }); $('.news-wrap-slider').owlCarousel({ items: 1, loop: true, nav: true, autoplay: true, autoplayHoverPause: true, mouseDrag: true, margin: 0, center: false, dots: false, smartSpeed: 1500, responsive: { 0: { items: 1, }, 576: { items: 1, }, 768: { items: 2, margin: 20, }, 992: { items: 2, }, 1200: { items: 2, }, }, navText: ["", "", ], }); $('.service-img-wrap').owlCarousel({ loop: true, margin: 0, nav: true, mouseDrag: true, items: 1, dots: false, autoHeight: true, autoplay: true, smartSpeed: 1500, autoplayHoverPause: true, animateOut: "flipOutY", navText: ["", "", ], }); $('#datetimepicker-1').datepicker({ weekStart: 0, todayBtn: "linked", language: "es", orientation: "bottom auto", keyboardNavigation: false, autoclose: true }); $('#datetimepicker-2').datepicker({ weekStart: 0, todayBtn: "linked", language: "es", orientation: "bottom auto", keyboardNavigation: false, autoclose: true }); $('#datetimepicker-3').datepicker({ weekStart: 0, todayBtn: "linked", language: "es", orientation: "bottom auto", keyboardNavigation: false, autoclose: true }); $('.go-top').on('click', function () { $("html, body").animate({ scrollTop: "0" }, 500); }); $('.accordion').find('.accordion-title').on('click', function () { $(this).toggleClass('active'); $(this).next().slideToggle('fast'); $('.accordion-content').not($(this).next()).slideUp('fast'); $('.accordion-title').not($(this)).removeClass('active'); }); function makeTimer() { var endTime = new Date("november 30, 2021 17:00:00 PDT"); var endTime = (Date.parse(endTime)) / 1000; var now = new Date(); var now = (Date.parse(now) / 1000); var timeLeft = endTime - now; var days = Math.floor(timeLeft / 86400); var hours = Math.floor((timeLeft - (days * 86400)) / 3600); var minutes = Math.floor((timeLeft - (days * 86400) - (hours * 3600)) / 60); var seconds = Math.floor((timeLeft - (days * 86400) - (hours * 3600) - (minutes * 60))); if (hours < "10") { hours = "0" + hours; } if (minutes < "10") { minutes = "0" + minutes; } if (seconds < "10") { seconds = "0" + seconds; } $("#days").html(days + "Days"); $("#hours").html(hours + "Hours"); $("#minutes").html(minutes + "Minutes"); $("#seconds").html(seconds + "Seconds"); } setInterval(function () { makeTimer(); }, 300); if ($('.wow').length) { var wow = new WOW({ mobile: false }); wow.init(); } $('.tab ul.tabs').addClass('active').find('> li:eq(0)').addClass('current'); $('.tab ul.tabs li').on('click', function (g) { var tab = $(this).closest('.tab'), index = $(this).closest('li').index(); tab.find('ul.tabs > li').removeClass('current'); $(this).closest('li').addClass('current'); tab.find('.tab_content').find('div.tabs_item').not('div.tabs_item:eq(' + index + ')').slideUp(); tab.find('.tab_content').find('div.tabs_item:eq(' + index + ')').slideDown(); g.preventDefault(); }); $('.tab .tabs').addClass('active').find('> .single-tab:eq(0)').addClass('current'); $('.tab .tabs .single-tab').on('click', function (g) { var tab = $(this).closest('.tab'), index = $(this).closest('.single-tab').index(); tab.find('.tabs > .single-tab').removeClass('current'); $(this).closest('.single-tab').addClass('current'); tab.find('.tab_content').find('div.tabs_item').not('div.tabs_item:eq(' + index + ')').slideUp(); tab.find('.tab_content').find('div.tabs_item:eq(' + index + ')').slideDown(); g.preventDefault(); }); $('.odometer').appear(function (e) { var odo = $(".odometer"); odo.each(function () { var countNumber = $(this).attr("data-count"); $(this).html(countNumber); }); }); $('.popup-youtube, .popup-vimeo').magnificPopup({ disableOn: 300, type: 'iframe', mainClass: 'mfp-fade', removalDelay: 160, preloader: false, fixedContentPos: false, }); $(".newsletter-form").validator().on("submit", function (event) { if (event.isDefaultPrevented()) { formErrorSub(); submitMSGSub(false, "Please enter a valid email ID."); } else { event.preventDefault(); } }); function callbackFunction(resp) { if (resp.result === "success") { formSuccessSub(); } else { formErrorSub(); } } function formSuccessSub() { $(".newsletter-form")[0].reset(); submitMSGSub(true, "You've successfully subscribed to our Newsletter!"); setTimeout(function () { $("#validator-newsletter").addClass('hide'); }, 4000) } function formErrorSub() { $(".newsletter-form").addClass("animated shake"); setTimeout(function () { $(".newsletter-form").removeClass("animated shake"); }, 1000) } function submitMSGSub(valid, msg) { if (valid) { var msgClasses = "validation-success"; } else { var msgClasses = "validation-danger"; } $("#validator-newsletter").removeClass().addClass(msgClasses).text(msg).show().delay(1000).fadeOut(); } $(".newsletter-form").ajaxChimp({ url: "https://envytheme.us20.list-manage.com/subscribe/post?u=60e1ffe2e8a68ce1204cd39a5&id=42d6d188d9", callback: callbackFunction }); var sync1 = $("#sync1"); var sync2 = $("#sync2"); var slidesPerPage = 4; var syncedSecondary = true; sync1.owlCarousel({ items: 1, autoplayHoverPause:true, slideSpeed: 4000, nav: true, navText: ["", "", ], autoplay: true, autoplaySpeed: 2000, dots: false, loop: true, responsiveRefreshRate: 200, mouseDrag: false, }).on('changed.owl.carousel', syncPosition); sync2.on('initialized.owl.carousel', function () { sync2.find(".owl-item").eq(0).addClass("current"); }).owlCarousel({ dots: false, autoplayHoverPause:true, nav: false, smartSpeed: 200, slideSpeed: 4000, autoplay: true, autoplaySpeed: 2000, loop: true, center: true, mouseDrag: false, slideBy: slidesPerPage, responsiveRefreshRate: 100, responsive: { 0: { items: 1 }, 576: { items: 2 }, 768: { items: 3 }, 992: { items: 3 }, 1200: { items: 3 } } }) function syncPosition(el) { var count = el.item.count - 1; var current = Math.round(el.item.index - (el.item.count / 2) - .5); if (current < 0) { current = count; } if (current > count) { current = 0; } sync2.find(".owl-item").removeClass("current").eq(current).addClass("current"); var onscreen = sync2.find('.owl-item.active').length - 1; var start = sync2.find('.owl-item.active').first().index(); var end = sync2.find('.owl-item.active').last().index(); if (current > end) { sync2.data('owl.carousel').to(current, 100, true); } if (current < start) { sync2.data('owl.carousel').to(current - onscreen, 100, true); } } $('.shorting').mixItUp(); objectFitImages(); jarallax(document.querySelectorAll('.jarallax')); jarallax(document.querySelectorAll('.jarallax-keep-img'), { keepImg: true, }); $('.input-counter').each(function () { var spinner = jQuery(this), input = spinner.find('input[type="text"]'), btnUp = spinner.find('.plus-btn'), btnDown = spinner.find('.minus-btn'), min = input.attr('min'), max = input.attr('max'); btnUp.on('click', function () { var oldValue = parseFloat(input.val()); if (oldValue >= max) { var newVal = oldValue; } else { var newVal = oldValue + 1; } spinner.find("input").val(newVal); spinner.find("input").trigger("change"); }); btnDown.on('click', function () { var oldValue = parseFloat(input.val()); if (oldValue <= min) { var newVal = oldValue; } else { var newVal = oldValue - 1; } spinner.find("input").val(newVal); spinner.find("input").trigger("change"); }); }); })(jQuery); $("#show-booking-form").click(function(){ // alert(1) $(".car-detailed-info").hide(); $(".booking-form-wrap").show(); }) // $(".prev-btn").click(function(){ // if($(this).parents(".steps-wrap").prev().length){ // $(this).parents(".steps-wrap").hide(); // $(this).parents(".steps-wrap").prev().show(); // // console.log("Still Exist!") // }else{ // $(".car-detailed-info").show(); // $(".booking-form-wrap").hide(); // // console.log("Not Working!!") // } // }) // $(".next-btn").click(function(){ // // alert(1) // $(this).parents(".steps-wrap").hide(); // $(this).parents(".steps-wrap").next().show(); // }) $(".prev-btn").click(function(){ if($(this).parents(".steps-wraper").prev().length){ $(this).parents(".steps-wraper").hide(); $(this).parents(".steps-wraper").prev().show(); $(".car-search-wrapper").find("li.active:not('.completed')").removeClass("active").prev().removeClass("completed"); // console.log("Still Exist!") }else{ $(".car-detailed-info").show(); $(".booking-form-wrap").hide(); // console.log("Not Working!!") } }) $(".next-btn").click(function(){ // alert(1) $(this).parents(".steps-wraper").hide(); $(this).parents(".steps-wraper").next().show(); $(".car-search-wrapper").find("li.active:not('.completed')").addClass("completed").next().addClass("active"); }) // car-search-wrapper $(".car-detail-without-search .car-search-wrapper a").click(function(){ // $(this).addClass("active") var el = $(this).parent().index() var contItem = $(".steps-wraper").index() console.log(el); $( ".car-search-wrapper li" ).removeClass("completed active"); $( ".car-search-wrapper li" ).slice( 0, el ).addClass("completed active"); $(this).parents("li").addClass("active") $(".steps-wraper").hide(); $(".steps-wraper").eq(el).show(); }); var sheet = document.createElement('style'), $rangeInput = $('.range input'), prefs = ['webkit-slider-runnable-track', 'moz-range-track', 'ms-track']; document.body.appendChild(sheet); var getTrackStyle = function (el) { var curVal = el.value, val = (curVal - 1) * 16.666666667, style = ''; // Set active label $('.range-labels li').removeClass('active selected'); var curLabel = $('.range-labels').find('li:nth-child(' + curVal + ')'); curLabel.addClass('active selected'); curLabel.prevAll().addClass('selected'); // Change background gradient for (var i = 0; i < prefs.length; i++) { style += '.range {background: linear-gradient(to right, #37adbf 0%, #37adbf ' + val + '%, #fff ' + val + '%, #fff 100%)}'; style += '.range input::-' + prefs[i] + '{background: linear-gradient(to right, #37adbf 0%, #37adbf ' + val + '%, #b2b2b2 ' + val + '%, #b2b2b2 100%)}'; } return style; } $rangeInput.on('input', function () { sheet.textContent = getTrackStyle(this); }); // Change input value on label click $('.range-labels li').on('click', function () { var index = $(this).index(); $rangeInput.val(index + 1).trigger('input'); }); $('.additional[type="checkbox"]').click(function () { var inputValue = $(this).attr("value"); var targetBox = $("." + inputValue); if(targetBox){ $(".boxxx").not(targetBox).hide(); $(targetBox).show(); }else{ $(targetBox).hide(); } }); // function valueChanged() // { // if($('.add_driver').is(":checked")) // $(".additional-block").show(); // else // $(".additional-block").hide(); // } // $(".additional-block-driver").hide(); $(".add_driver").click(function() { if($(this).is(":checked")) { $(".additional-block-driver").show(); } else { $(".additional-block-driver").hide(); } }); // $(".additional-block-baby").hide(); $(".add_baby").click(function() { if($(this).is(":checked")) { $(".additional-block-baby").show(); } else { $(".additional-block-baby").hide(); } }); // $(".additional-block-child").hide(); $(".add_child").click(function() { if($(this).is(":checked")) { $(".additional-block-child").show(); } else { $(".additional-block-child").hide(); } }); // $(".additional-block-mileage").hide(); $(".add_mileage").click(function() { if($(this).is(":checked")) { $(".additional-block-mileage").show(); } else { $(".additional-block-mileage").hide(); } }); $(".filter-trigger").click(function() { $("#fillter-drop").toggle(); }) $(document).mouseup(function(e) { var container = $("#fillter-drop"); // if the target of the click isn't the container nor a descendant of the container if (!container.is(e.target) && container.has(e.target).length === 0) { container.hide(); } }); if ($(window).width() < 767){ if($('.dashboard-left .block-content ul li.active').length > 0) { setTimeout( function(){ // $(".dashboard-left .block-content ul li a").click(function(){ $('html, body').animate({ scrollTop: $(".dashboard-right").offset().top - 100 }, 2000); // }); // code },1000); } } $("#home-pick-up-date").attr('readonly','readonly'); $("#home-drop-off-date").attr('readonly','readonly');