$(document).ready(function () { $("#destination").click(function () { $('#sector-outer').toggleClass("open"); }); $("#month").click(function () { $('#monthpopup').toggleClass("open"); }); $("#roomsguest").click(function () { $('#guestPopup').toggleClass("open"); }); $("#price").click(function () { $('#pricepopup').toggleClass("open"); }); $(".search-container .ow-row.details > li .child").click(function (e) { e.stopPropagation(); }); $(".search-container .ow-row.details > li").click(function () { var sdiv = $(this).attr("data-target"); $("#" + sdiv).toggleClass("open"); }); $("#feedback,#review, #close-slidepanel,#more-travellers, .viewdetails-btn-mobile").click(function () { $('.slide-panel').toggleClass("open"); $("body").toggleClass("overflow-hidden"); }); $(".floatingbtn").click(function () { $(this).parent().css("pointer-events", "all"); $(this).toggleClass("labelshow"); $(this).nextAll().toggleClass("active"); $("body").toggleClass("overlay-added"); }); $(".floatinigbtnouter").mouseleave(function () { $(".floatingbtn").removeClass("labelshow"); $(".floatingbtn").nextAll().removeClass("active"); $("body").removeClass("overlay-added"); $(this).css("pointer-events", "none"); }); var scrollTop = $(".scroll-up"); $(window).scroll(function () { var topPos = $(this).scrollTop(); if (topPos > 100) { $(scrollTop).addClass("visible"); } else { $(scrollTop).removeClass("visible"); } if (topPos > 100) { $(".sticky-header").addClass("show"); } else { $(".sticky-header").removeClass("show"); } if ($(window).scrollTop() == ($(document).height() - $(window).height())) { $(".floatingbtn").addClass("hidden"); } else { $(".floatingbtn").removeClass("hidden"); } }); $(scrollTop).click(function () { $('html, body').animate({ scrollTop: 0 }, 800); return false; }); $("#sharebtn").click(function () { $(this).toggleClass("shareOpened"); $("#share-group").toggleClass("shareOpened"); }); // design changes 27nov2023 start $("#modifysearch-close, #modifysearch-close1").click(function () { // design changes 27nov2023 end $(this).toggleClass("modify-search-opened"); $("#modifysearch-content").toggleClass("modify-search-opened"); $('.price-popup,.guest-popup,.calendarOuter').removeClass("open"); }); $("#modifysearch,#fromCity,#modiPriceCate,#roomsGuests,#tourDate").click(function () { $("#modifysearch").toggleClass("modify-search-opened"); $("#modifysearch-content").toggleClass("modify-search-opened"); }); $(".defaultfromCity").click(function () { $("#modifysearch").toggleClass("modify-search-opened"); $("#modifysearch-content").toggleClass("modify-search-opened"); }); if ($(window).width() <= 800) { $("#modifysearch").click(function () { $(this).removeClass("modify-search-opened"); $("body").addClass("overflow-hidden"); }); $("#modifysearch-content .firstbox .modify-search-heading .icon").click(function () { $("#modifysearch").removeClass("modify-search-opened"); $("#modifysearch-content").removeClass("modify-search-opened"); $("body").removeClass("overflow-hidden"); }); } $("#showmobilefilter").click(function () { $("#filtersection").addClass("open"); $("body").addClass("overflow-hidden"); }); $("#filtersection .filter-header .icon").click(function () { $("#filtersection").addClass("leaveanimation"); setTimeout(function () { $("#filtersection").removeClass("open"); $("body").removeClass("overflow-hidden"); $("#filtersection").removeClass("leaveanimation"); }, 300); }); $("#showsort").click(function () { $("#mobile-sort").addClass("open"); $("body").addClass("overflow-hidden"); }); $("#mobile-sort .header .icon").click(function () { $("#mobile-sort").addClass("leaveanimation"); setTimeout(function () { $("#mobile-sort").removeClass("open"); $("body").removeClass("overflow-hidden"); $("#mobile-sort").removeClass("leaveanimation"); }, 300); }); $(".messageblock div .ak-cancel").click(function () { $(this).parents(".messageblock").css("display", "none"); }); $('.mobile-payment ul li a, .popup-wrapper .box .radio-ul li, .popup-wrapper table tbody tr').click(function () { var targetid = $(this).attr('data-target'); // console.log(targetid); $("body").addClass("overflow-hidden"); $("#" + targetid).addClass("open"); }); $(".popup-wrapper .ak-back").click(function () { var targetclose = $(this).attr('data-target'); $("#" + targetclose).addClass('leaveanimation'); setTimeout(function () { $("#" + targetclose).removeClass("open"); $("body").removeClass("overflow-hidden"); $("#" + targetclose).removeClass('leaveanimation'); }, 300); }); // $("#get-nearby-branches").click(function () { // $(".nearby-branches-wrapper").slideDown(300); // $(".nearby-branches-wrapper h2").css({ "text-align": "left" }); // $(".hide-on-btn-click").slideUp(300); // }); var slider = document.getElementById('budget-slider'); // noUiSlider.create(slider, { // start: [20, 50], // connect: true, // step: 1, // orientation: 'horizontal', // 'horizontal' or 'vertical' // range: { // 'min': 0, // 'max': 100 // }, // format: wNumb({ // decimals: 0 // }) // }); var slider = document.getElementById('time-slider'); // noUiSlider.create(slider, { // start: [20, 80], // connect: true, // step: 1, // orientation: 'horizontal', // 'horizontal' or 'vertical' // range: { // 'min': 0, // 'max': 100 // }, // format: wNumb({ // decimals: 0 // }) // }); //Initialization $('.collapsible').collapsible(); $('.modal').modal(); $('.dropdown-trigger').dropdown(); $('select').formSelect(); $('.tabs').tabs(); }); // autocomplete search field: START function openAutocomplete() { document.getElementById("autocomplete-dropdown").classList.toggle("show"); document.getElementById("autoCompInput").focus(); } function autoCompFilterFn() { var input, filter, ul, li, a, i; input = document.getElementById("autoCompInput"); filter = input.value.toUpperCase(); div = document.getElementById("autocomplete-options"); a = div.getElementsByTagName("a"); span = div.getElementsByClassName("option"); console.log(span); for (i = 0; i < a.length; i++) { txtValue = a[i].textContent || a[i].innerText; if (txtValue.toUpperCase().indexOf(filter) > -1) { span[i].style.display = ""; } else { span[i].style.display = "none"; } } } // autocomplete search field: END // learn more popup $("#learnmorebutton").click(() => { $("#learnmorepopup").toggleClass("show"); }); $("#learnmorepopup .icon").click(() => { $("#learnmorepopup").toggleClass("show"); }); $("#moblearnmorebutton").click(() => { $("#learnmorepopup").toggleClass("show"); }); $("#moblearnmorepopup .icon").click(() => { $("#learnmorepopup").toggleClass("show"); }); // learn more popup // loading popup // $(".make-payment-btn").click(() => { // $("#loading").toggleClass("show"); // }); // loading popup $('.moreless-button').click(function() { $('.moretext').slideToggle(); if ($('.moreless-button').text() == "Read more") { $(this).text("Read less") } else { $(this).text("Read more") } }); $("#t_mth").click(function(){ $('#calendar-month').toggleClass('open'); }); // new accomodation design $(".accomodation-accordion > .room-type").first().toggleClass("active"); $(".accomodation-accordion > .room-type > .heading").click(function () { $(".room-type").removeClass("active"); $(this).parent().toggleClass("active"); }); // new accomodation design // design changes 27nov2023 start $("#downloadpdf").click(function () { $("#download-package-content").modal('open'); }); // design changes 27nov2023 end