/* Author : Dreamguys Template Name: Truelysell - Bootstrap Template */ (function ($) { "use strict"; var $slimScrolls = $('.slimscroll'); var $wrapper = $('.main-wrapper'); // Sidebar Slimscroll if ($slimScrolls.length > 0) { $slimScrolls.slimScroll({ height: 'auto', width: '100%', position: 'right', size: '7px', color: '#ccc', allowPageScroll: false, wheelStep: 10, touchScrollStep: 100 }); var wHeight = $(window).height() - 48; $slimScrolls.height(wHeight); $('.sidebar .slimScrollDiv').height(wHeight); $(window).resize(function () { var rHeight = $(window).height() - 48; $slimScrolls.height(rHeight); $('.sidebar .slimScrollDiv').height(rHeight); }); } // Mobile menu sidebar overlay $('body').append('
'); $(document).on('click', '#mobile_btns', function () { $wrapper.toggleClass('slide-nav'); $('.sidebar-overlay').toggleClass('opened'); $('html').toggleClass('menu-opened'); return false; }); $(document).on('click', '#mobile_btn', function () { $wrapper.toggleClass('slide-nav'); $('.sidebar-overlay').toggleClass('opened'); $('html').addClass('menu-opened'); $('#task_window').removeClass('opened'); return false; }); $(".sidebar-overlay").on("click", function () { $('html').removeClass('menu-opened'); $(this).removeClass('opened'); $wrapper.removeClass('slide-nav'); $('.sidebar-overlay').removeClass('opened'); $('#task_window').removeClass('opened'); }); // Sidebar if ($(window).width() <= 991) { var Sidemenu = function () { this.$menuItem = $('.main-nav a'); }; function init() { var $this = Sidemenu; $('.main-nav a').on('click', function (e) { if ($(this).parent().hasClass('has-submenu')) { e.preventDefault(); } if (!$(this).hasClass('submenu')) { $('ul', $(this).parents('ul:first')).slideUp(350); $('a', $(this).parents('ul:first')).removeClass('submenu'); $(this).next('ul').slideDown(350); $(this).addClass('submenu'); } else if ($(this).hasClass('submenu')) { $(this).removeClass('submenu'); $(this).next('ul').slideUp(350); } }); } // Sidebar Initiate init(); } // Sticky Header $(window).scroll(function () { var sticky = $('.header'), scroll = $(window).scrollTop(); if (scroll >= 50) sticky.addClass('fixed'); else sticky.removeClass('fixed'); }); $(document).on('click', '.sidebar-overlay', function () { $('html').removeClass('menu-opened'); $(this).removeClass('opened'); $('main-wrapper').removeClass('slide-nav'); $('#task_window').removeClass('opened'); }); $(document).on('click', '#menu_close', function () { $('html').removeClass('menu-opened'); $('.sidebar-overlay').removeClass('opened'); $('main-wrapper').removeClass('slide-nav'); }); // Small Sidebar //toggle_btn $(document).on('click', '#toggle_btn', function () { if ($('body').hasClass('mini-sidebar')) { $('body').removeClass('mini-sidebar'); $(this).addClass('active'); $('.subdrop + ul'); localStorage.setItem('screenModeNightTokenState', 'night'); setTimeout(function () { $("body").removeClass("mini-sidebar"); $(".header-left").addClass("active"); }, 100); } else { $('body').addClass('mini-sidebar'); $(this).removeClass('active'); $('.subdrop + ul'); localStorage.removeItem('screenModeNightTokenState', 'night'); setTimeout(function () { $("body").addClass("mini-sidebar"); $(".header-left").removeClass("active"); }, 100); } return false; }); function initi() { var $this = Sidemenu; $('#sidebar-menu a').on('click', function (e) { if ($(this).parent().hasClass('submenu')) { e.preventDefault(); } if (!$(this).hasClass('subdrop')) { $('ul', $(this).parents('ul:first')).slideUp(350); $('a', $(this).parents('ul:first')).removeClass('subdrop'); $(this).next('ul').slideDown(350); $(this).addClass('subdrop'); } else if ($(this).hasClass('subdrop')) { $(this).removeClass('subdrop'); $(this).next('ul').slideUp(350); } }); $('#sidebar-menu ul li.submenu a.active').parents('li:last').children('a:first').addClass('active').trigger('click'); } initi(); // Sidebar Initiate $(document).on('mouseover', function (e) { e.stopPropagation(); if ($('body').hasClass('mini-sidebar') && $('#toggle_btn').is(':visible')) { var targ = $(e.target).closest('.sidebar, .header-left').length; if (targ) { $('body').addClass('expand-menu'); $('.subdrop + ul').slideDown(); } else { $('body').removeClass('expand-menu'); $('.subdrop + ul').slideUp(); } return false; } }); // Chat sidebar overlay if ($(window).width() <= 1199) { if ($('#task_chat').length > 0) { $(document).on('click', '#task_chat', function () { $('.sidebar-overlay').toggleClass('opened'); $('#task_window').addClass('opened'); return false; }); } } $(".chat-profile-open").on("click", function () { $('.chat-window-long').toggleClass('window-full-width'); }); $(document).on('click', '#filter_search', function () { $('#filter_inputs').slideToggle("slow"); }); // horizontal-slide document.addEventListener("DOMContentLoaded", function () { const scrollers = document.querySelectorAll(".horizontal-slide"); scrollers.forEach((scroller) => { scroller.setAttribute("data-animated", true); const scrollerInner = scroller.querySelector(".slide-list"); const scrollerContent = Array.from(scrollerInner.children); scrollerContent.forEach((item) => { const duplicatedItem = item.cloneNode(true); duplicatedItem.setAttribute("aria-hidden", true); scrollerInner.appendChild(duplicatedItem); }); }); }); // Testimonial if($('.testimonial-slider-two').length > 0) { $(".testimonial-slider-two").slick({ slidesToShow: 1, slidesToScroll: 1, autoplay: false, autoplaySpeed: 0, speed: 3000, autoplaySpeed: 1800, arrows: true, prevArrow: $('.testimonial-prev'), nextArrow: $('.testimonial-next'), }); } const initWizard = () => { const wizardContainer = document.querySelector(".wizard-container"); // If this element isn't on the page, the function ends here safely if (!wizardContainer) return; const steps = wizardContainer.querySelectorAll(".wizard-step"); const progressBar = wizardContainer.querySelector("#progress-bar"); const nextBtns = wizardContainer.querySelectorAll(".nextBtn"); const prevBtns = wizardContainer.querySelectorAll(".prevBtn"); const cards = wizardContainer.querySelectorAll(".checkbox-item"); if (steps.length === 0) return; let currentStep = 0; // 1. Handle Selection Logic cards.forEach(card => { card.addEventListener("click", function(e) { const radio = this.querySelector('input[type="radio"]'); if (radio && e.target !== radio) { radio.checked = true; } const stepParent = this.closest('.wizard-step'); const siblings = stepParent.querySelectorAll(".checkbox-item"); siblings.forEach(s => s.classList.remove("active")); this.classList.add("active"); // --- NEW: Toggle Textarea Logic --- const othersWrapper = document.getElementById("others-details"); if (othersWrapper) { // Show if the clicked card has the data-type="others" attribute if (this.getAttribute("data-type") === "others") { othersWrapper.style.display = "block"; } else { othersWrapper.style.display = "none"; } } }); }); // 2. Navigation Logic const updateWizard = () => { steps.forEach((step, index) => { step.classList.toggle("active", index === currentStep); // Since steps are stacked in your HTML, we hide/show them step.style.display = (index === currentStep) ? "block" : "none"; }); if (progressBar) { const progress = ((currentStep + 1) / steps.length) * 100; progressBar.style.width = progress + "%"; } }; // Next Buttons nextBtns.forEach(btn => { btn.addEventListener("click", (e) => { e.preventDefault(); if (currentStep < steps.length - 1) { currentStep++; updateWizard(); } }); }); // Prev Buttons prevBtns.forEach(btn => { btn.addEventListener("click", (e) => { e.preventDefault(); if (currentStep > 0) { currentStep--; updateWizard(); } }); }); // Run once on load updateWizard(); }; // Run when the DOM is ready if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", initWizard); } else { initWizard(); } })(jQuery); $(document).ready(function () { // Sidebar Toggle Js $(".offcanvas-close,.offcanvas-overlay").on("click", function () { $(".offcanvas-info").removeClass("show"); $(".offcanvas-overlay").removeClass("overlay-open"); }); $(".sidebar-menu").on("click", function () { $(".offcanvas-info").addClass("show"); $(".offcanvas-overlay").addClass("overlay-open"); }); if ($('#data-table').length > 0) { $('#data-table').DataTable({ "language": { search: ' ', searchPlaceholder: "Search...", info: "_START_ - _END_ of _TOTAL_", paginate: { next: 'Next ', previous: ' Previous' } }, "bFilter": false, initComplete: (settings, json) => { $('.dataTables_length').appendTo('#tablelength'); $('.dataTables_paginate').appendTo('#tablepagination'); $('.dataTables_info').appendTo('#tableinfo'); }, }); } // Body Overlay Js $(".body-overlay").on("click", function () { $(".offcanvas__area").removeClass("offcanvas-opened"); $(".df-search-area").removeClass("opened");; $(".body-overlay").removeClass("opened"); }); // Sticky Header $(window).scroll(function () { if ($(this).scrollTop() > 200) { $("header").addClass("fixed"); } else { $("header").removeClass("fixed"); } }); if ($('.wow').length > 0) { new WOW().init(); } // Fav Icon if ($('.fav-icon').length > 0) { $(".fav-icon").on("click", function () { $(this).toggleClass('selected'); }); } // Booking Select if ($('.select-item').length > 0) { $(".select-item").on("click", function () { $('.select-item').removeClass('selected'); $(this).toggleClass('selected'); }); } if ($('.location-card').length > 0) { $(".location-card").on("click", function () { $('.location-card').removeClass('selected'); $(this).toggleClass('selected'); }); } if ($('.staff-card').length > 0) { $(".staff-card").on("click", function () { $('.staff-card').removeClass('selected'); $(this).toggleClass('selected'); }); } if ($('.time-item').length > 0) { $(".time-item").on("click", function () { $('.time-item').removeClass('selected'); $(this).toggleClass('selected'); }); } // Add if ($('.btn-addon').length > 0) { $('.btn-addon').on('click', function (e) { $(this).addClass("active"); $(this).text("Added"); $(this).prepend(""); }); } //Owl Carousel if ($('.providers-slider').length > 0) { $('.providers-slider').owlCarousel({ loop: true, margin: 10, nav: true, navText: [ '', '' ], responsive: { 0: { items: 1 }, 600: { items: 3 }, 1000: { items: 4 } } }) } // Service slider if ($('.owl-carousel.feature-service-five-slider').length > 0) { $('.owl-carousel.feature-service-five-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 1 }, 700: { items: 2 }, 1200: { items: 3 }, 1400: { items: 3 } } }) } // Service Slider if ($('.service-slider').length > 0) { $('.service-slider').owlCarousel({ loop: false, margin: 24, nav: true, dots: false, smartSpeed: 2000, autoplay: false, navText: [ '', '' ], // FIX: Add aria-labels once the carousel is ready onInitialized: setNavLabels, onRefreshed: setNavLabels, responsive: { 0: { items: 1 }, 550: { items: 1 }, 768: { items: 2 }, 992: { items: 3 }, 1200: { items: 3 } } }) } // Function to add accessible names to the buttons function setNavLabels(event) { const $carousel = $(event.target); $carousel.find('.owl-prev').attr('aria-label', 'Previous'); $carousel.find('.owl-next').attr('aria-label', 'Next'); // 2. Look inside your custom navContainer (Fix) const customNav = $('.mynav1'); // Match your navContainer selector if (customNav.length > 0) { customNav.find('.owl-prev').attr('aria-label', 'Previous Slide'); customNav.find('.owl-next').attr('aria-label', 'Next Slide'); } } if ($('.say-about.slider-for').length > 0) { $('.say-about.slider-for').slick({ slidesToShow: 1, slidesToScroll: 1, arrows: false, fade: true, asNavFor: '.client-img.slider-nav' }); } if ($('.client-img.slider-nav').length > 0) { $('.client-img.slider-nav').slick({ slidesToShow: 3, slidesToScroll: 1, asNavFor: '.say-about.slider-for', dots: false, arrows: false, centerMode: true, focusOnSelect: true }); } // latest-slider if ($('.owl-carousel.latest-slider').length > 0) { $('.owl-carousel.latest-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, // FIX: Add aria-labels once the carousel is ready onInitialized: setNavLabels, onRefreshed: setNavLabels, navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 3 }, 1200: { items: 4 }, 1400: { items: 4 } } }) } // services-slider if ($('.owl-carousel.stylists-slider').length > 0) { $('.owl-carousel.stylists-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 1 }, 700: { items: 2 }, 1200: { items: 4 }, 1400: { items: 4 } } }) } // Service slider if ($('.owl-carousel.partners-slider').length > 0) { $('.owl-carousel.partners-slider').owlCarousel({ loop: true, margin: 24, nav: false, dots: false, smartSpeed: 2000, responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 3 }, 1200: { items: 5 }, 1400: { items: 5 } } }) } //Home slider if ($('.banner-slider').length > 0) { $('.banner-slider').slick({ dots: false, autoplay: false, infinite: true, slidesToShow: 1, slidesToScroll: 1, arrows: true, responsive: [{ breakpoint: 992, settings: { slidesToShow: 1 } }, { breakpoint: 800, settings: { slidesToShow: 1 } }, { breakpoint: 776, settings: { slidesToShow: 1 } }, { breakpoint: 567, settings: { slidesToShow: 1 } }] }); } $(".top-close").on('click', function () { $(this).closest('.top-bar').slideUp(500); return false; }); // Popular Service slider if ($('.owl-carousel.popular-slider').length > 0) { $('.owl-carousel.popular-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, navText: ["", ""], navContainer: '.mynav1', onInitialized: setNavLabels, // Aria label onRefreshed: setNavLabels, // Aria label responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 2 }, 1000: { items: 3 } } }) } // Popular Service slider if ($('.popular-slider-3').length > 0) { $('.popular-slider-3').owlCarousel({ loop: false, margin: 24, nav: true, dots: false, smartSpeed: 2000, onInitialized: setNavLabels, // Aria label onRefreshed: setNavLabels, // Aria label navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 2 }, 1000: { items: 3 } } }) } // Service slider if ($('.owl-carousel.car-testimonials-five-slider').length > 0) { $('.owl-carousel.car-testimonials-five-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 1 }, 700: { items: 1 }, 1000: { items: 1 } } }) } // Service slider if ($('.owl-carousel.partners-five-slider').length > 0) { $('.owl-carousel.partners-five-slider').owlCarousel({ loop: true, margin: 24, nav: false, dots: false, autoplay: true, smartSpeed: 2000, responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 3 }, 1200: { items: 5 }, 1400: { items: 5 } } }) } // Service slider if ($('.owl-carousel.car-blog-slider').length > 0) { $('.owl-carousel.car-blog-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, onInitialized: setNavLabels, // Aria label onRefreshed: setNavLabels, // Aria label navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 2 }, 1000: { items: 3 } } }) } // Popular Service slider -02 if ($('.owl-carousel.popular-slider-2').length > 0) { $('.owl-carousel.popular-slider-2').owlCarousel({ loop: true, margin: 24, nav: false, dots: true, smartSpeed: 2000, navText: ["", ""], navContainer: '.mynav1', responsive: { 0: { items: 1, }, 550: { items: 2, }, 700: { items: 2, }, 1000: { items: 3, } } }) } // Service slider if ($('.owl-carousel.top-providers-five').length > 0) { $('.owl-carousel.top-providers-five').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 1 }, 700: { items: 3 }, 1200: { items: 4 }, 1400: { items: 4 } } }) } //Feature Carousel if ($('.feature-slider').length > 0) { $('.feature-slider').owlCarousel({ loop: false, margin: 24, nav: true, dots: false, smartSpeed: 2000, autoplay: false, navText: [ '', '' ], onInitialized: setNavLabels, // Aria label onRefreshed: setNavLabels, // Aria label responsive: { 0: { items: 1 }, 550: { items: 1 }, 768: { items: 2 }, 1000: { items: 4 } } }) } //Card Image Carousel if ($('.img-slider').length > 0) { $('.img-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: true, smartSpeed: 2000, autoplay: false, onInitialized: setCarouselAccessibility , // Aria label onRefreshed: setCarouselAccessibility , // Aria label navText: [ '', '' ], responsive: { 0: { items: 1 }, 550: { items: 1 }, 768: { items: 1 }, 1000: { items: 1 } } }) } function setCarouselAccessibility (event) { const $carousel = $(event.target); // Label Navigation Buttons (Arrows) $carousel.find('.owl-prev').attr('aria-label', 'Previous Slide'); $carousel.find('.owl-next').attr('aria-label', 'Next Slide'); // Label Pagination Dots $carousel.find('.owl-dot').each(function(index) { $(this).attr('aria-label', 'Go to slide ' + (index + 1)); }); } //catering-slider if ($('.catering-slider').length > 0) { $('.catering-slider').owlCarousel({ loop: true, margin: 24, nav: false, dots: true, smartSpeed: 2000, autoplay: false, onInitialized: setNavLabels, // Aria label onRefreshed: setNavLabels, // Aria label navText: [ '', '' ], responsive: { 0: { items: 1 }, 550: { items: 2 }, 768: { items: 3 }, 1000: { items: 4 } } }) } // Testimonial slider if ($('.testimonial-slider').length > 0) { $('.testimonial-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, onInitialized: setNavLabels, // Aria label onRefreshed: setNavLabels, // Aria label navText: ["", ""], responsive: { 0: { items: 1 }, 992: { items: 2 }, 1000: { items: 3 } } }) } // Testimonial slider if ($('.testimonial-slider-3').length > 0) { $('.testimonial-slider-3').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, onInitialized: setNavLabels, // Aria label onRefreshed: setNavLabels, // Aria label navText: ["", ""], responsive: { 0: { items: 1 }, 992: { items: 2 }, 1000: { items: 2 } } }) } // Testimonial slider-02 if ($('.testimonial-slider2').length > 0) { $('.testimonial-slider2').owlCarousel({ loop: true, margin: 24, nav: false, dots: false, smartSpeed: 2000, navText: ["", ""], responsive: { 0: { items: 1 }, 700: { items: 4 }, 1000: { items: 5 } } }) } // Blog Slider if ($('.blog-slider').length > 0) { $('.blog-slider').owlCarousel({ loop: true, margin: 24, nav: true, dots: false, smartSpeed: 2000, autoplay: false, onInitialized: setNavLabels, // Aria label onRefreshed: setNavLabels, // Aria label navText: [ '', '' ], responsive: { 0: { items: 1 }, 550: { items: 1 }, 768: { items: 2 }, 992: { items: 3 }, 1200: { items: 4 } } }) } // Gallery Slider if ($('.gallery-slider').length > 0) { $('.gallery-slider').owlCarousel({ loop: true, margin: 16, nav: true, dots: false, smartSpeed: 2000, autoplay: false, onInitialized: setNavLabels, // Aria label onRefreshed: setNavLabels, // Aria label navText: [ '', '' ], responsive: { 0: { items: 2 }, 550: { items: 4 }, 992: { items: 4 }, 1200: { items: 5 }, 1400: { items: 6 } } }) } // Service Slider if ($('.service-carousel').length > 0) { $(document).ready(function () { var sync1 = $("#large-img"); var sync2 = $("#small-img"); var slidesPerPage = 5; // Number of thumbnails per page var syncedSecondary = true; sync1.owlCarousel({ items: 1, slideSpeed: 2000, nav: true, autoplay: false, dots: false, loop: true, navText: [ '', '' ], responsiveRefreshRate: 200, }).on('changed.owl.carousel', syncPosition); sync2.owlCarousel({ items: slidesPerPage, dots: false, nav: true, margin: 10, smartSpeed: 1000, slideSpeed: 500, slideBy: slidesPerPage, responsiveRefreshRate: 100, navText: [ '', '' ], }).on('initialized.owl.carousel', function () { sync2.find(".owl-item").eq(0).addClass("current"); }).on('changed.owl.carousel', syncPosition2); 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); } } function syncPosition2(el) { if (syncedSecondary) { var number = el.item.index; sync1.data('owl.carousel').to(number, 100, true); } } sync2.on("click", ".owl-item", function (e) { e.preventDefault(); var number = $(this).index(); sync1.data('owl.carousel').to(number, 300, true); }); }); } // Vertical Slider if ($('.vertical-slider').length > 0) { $('.slider-for').slick({ slidesToShow: 1, slidesToScroll: 1, arrows: false, fade: true, asNavFor: '.slider-nav' }); $('.slider-nav').slick({ slidesToShow: 4, slidesToScroll: 1, vertical: true, asNavFor: '.slider-for', dots: false, arrows: true, focusOnSelect: true, verticalSwiping: true, prevArrow: "", nextArrow: "", responsive: [ { breakpoint: 992, settings: { slidesToShow: 3, } }, { breakpoint: 768, }, { breakpoint: 580, settings: { slidesToShow: 2, } }, { breakpoint: 0, settings: { vertical: false, slidesToShow: 1, } } ] }); } // Radio active if ($('.form-radio').length > 0) { $('.form-radio').on('click', function (e) { e.preventDefault(); var radioButton = $(this).find('input[type="radio"]'); var groupName = radioButton.attr('name'); $('.form-radio').each(function () { var currentRadioButton = $(this).find('input[type="radio"]'); if (currentRadioButton.attr('name') === groupName) { $(this).removeClass('active'); currentRadioButton.prop('checked', false); } }); $(this).addClass('active'); radioButton.prop('checked', true); }); } if ($('.group-radio').length > 0) { $('.group-radio .form-check').on('click', function (e) { e.preventDefault(); var radioButton = $(this).find('input[type="radio"]'); var groupName = radioButton.attr('name'); $('.group-radio').each(function () { var currentRadioButton = $(this).find('input[type="radio"]'); if (currentRadioButton.attr('name') === groupName) { currentRadioButton.prop('checked', false); } }); radioButton.prop('checked', true); }); } // Checkbox Active if ($('.form-checkbox').length > 0) { $('.form-checkbox').on('click', function (e) { e.stopPropagation(); $(this).toggleClass('active'); var checkbox = $(this).find('input[type="checkbox"]'); checkbox.prop('checked', !checkbox.prop('checked')); }); // Click event specifically for the checkbox input $('.form-checkbox input[type="checkbox"]').on('click', function (e) { $(this).closest('.form-checkbox').toggleClass('active'); var checkbox = $(this).find('input[type="checkbox"]'); checkbox.prop('checked', !checkbox.prop('checked')); }); } // Checkbox Active if ($('.payment-item').length > 0) { $('.payment-item').on('click', function (e) { e.preventDefault(); var radioButton = $(this).find('input[type="radio"]'); var groupName = radioButton.attr('name'); $('.payment-item').each(function () { var currentRadioButton = $(this).find('input[type="radio"]'); if (currentRadioButton.attr('name') === groupName) { $(this).removeClass('active'); currentRadioButton.prop('checked', false); } }); $(this).addClass('active'); radioButton.prop('checked', true); // Toggle 'active' class on #btn based on the checked state of the radio button if (radioButton.prop('checked')) { $('#pay-btn').addClass('active'); } else { $('#pay-btn').removeClass('active'); } }); } // Scroll Top $(window).scroll(function () { var scroll = $(window).scrollTop(); if (scroll >= 500) { $(".back-to-top-icon").addClass("show"); } else { $(".back-to-top-icon").removeClass("show"); } }); // More btn $('.more-btn').on('click', function () { var text = $('.more-text'); var btn = $(this); if (text.hasClass('expanded')) { text.removeClass('expanded'); btn.text('Read More'); } else { text.addClass('expanded'); btn.text('Read Less'); } }); // Service slider if ($('.owl-carousel.customer-review-slider').length > 0) { $('.owl-carousel.customer-review-slider').owlCarousel({ loop: true, margin: 24, nav: false, dots: true, smartSpeed: 2000, navText: ["", ""], responsive: { 0: { items: 1 }, 550: { items: 1 }, 700: { items: 1 }, 1000: { items: 1 } } }) } // Service slider if ($('.owl-carousel.service-nine-slider').length > 0) { $('.owl-carousel.service-nine-slider').owlCarousel({ loop: true, margin: 24, nav: false, dots: true, smartSpeed: 2000, navText: ["", ""], dotsContainer: '.slidernav', responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 2 }, 1200: { items: 4 }, 1400: { items: 4 } } }) } // Service slider if ($('.owl-carousel.additional-slider').length > 0) { $('.owl-carousel.additional-slider').owlCarousel({ loop: true, margin: 24, nav: false, dots: true, smartSpeed: 2000, navText: ["", ""], dotsContainer: '.slidernav1', responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 2 }, 1200: { items: 4 }, 1400: { items: 4 } } }) } // Blogs slider if ($('.owl-carousel.blogs-nine-slider').length > 0) { $('.owl-carousel.blogs-nine-slider').owlCarousel({ loop: true, margin: 24, nav: false, dots: true, smartSpeed: 2000, navText: ["", ""], dotsContainer: '.slidernav2', responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 2 }, 1200: { items: 3 }, 1400: { items: 3 } } }) } // Provider slider if ($('.owl-carousel.provider-nine-slider').length > 0) { $('.owl-carousel.provider-nine-slider').owlCarousel({ loop: true, margin: 24, nav: false, dots: true, smartSpeed: 2000, navText: ["", ""], dotsContainer: '.slidernav3', responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 3 }, 1200: { items: 4 }, 1400: { items: 4 } } }) } // Provider slider if ($('.owl-carousel.provider-nine-slider2').length > 0) { $('.owl-carousel.provider-nine-slider2').owlCarousel({ loop: true, margin: 24, nav: false, dots: true, smartSpeed: 2000, navText: ["", ""], dotsContainer: '.slidernav4', responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 3 }, 1200: { items: 4 }, 1400: { items: 4 } } }) } // Quote-slider if ($('.owl-carousel.quote-slider').length > 0) { $('.owl-carousel.quote-slider').owlCarousel({ loop: true, margin: 24, nav: false, dots: false, smartSpeed: 2000, autoplay: true, responsive: { 0: { items: 1 }, 550: { items: 2 }, 700: { items: 3 }, 1200: { items: 5 }, 1400: { items: 5 } } }) } }); // Provider Wizard $(document).ready(function () { /*---------------------------------------------------------*/ $(".wizard-fieldset #first-field .next_btn").on('click', function () { $('#providerwizard .active').removeClass('active').addClass('active').next().addClass(''); }); $(".wizard-fieldset .next_btn").on('click', function () { // Function Runs On NEXT Button Click $(this).closest('fieldset').next().fadeIn('slow'); $(this).closest('fieldset').css({ 'display': 'none' }); $.fn.hasId = function (id) { return this.closest('#' + id).length > 0; }; // Adding Class Active To Show Steps Forward; if ($(this).hasId('first-field')) { $('#providerwizard .active').addClass('active'); } else { $('#providerwizard .active').removeClass('active').addClass('activated').next().addClass('active'); } }); $(".wizard-fieldset .prev_btn").on('click', function () { // Function Runs On NEXT Button Click $(this).closest('fieldset').prev().fadeIn('slow'); $(this).closest('fieldset').css({ 'display': 'none' }); // Adding Class Active To Show Steps Forward; if ($(this).closest('.second-field').length) { $(this).closest('.wizard-fieldset').find('#providerwizard li:first-child').addClass('active'); } else { $('#providerwizard .active').removeClass('active').prev().removeClass('activated').addClass('active'); } }); }); // Provider Wizard $(document).ready(function () { if ($('.progress-fieldset').length > 0) { let currentStep = 0; const totalSteps = $(".progress-fieldset fieldset").length; // Assuming each fieldset represents a step const progressBar = $(".progress-bar"); // Your progress bar element // Function to update the progress bar based on the current step function updateProgress() { const percent = (currentStep / (totalSteps - 1)) * 100; progressBar.css('width', percent + "%"); } // NEXT Button Click $(".progress-fieldset .next_btn").on('click', function () { if (currentStep < totalSteps - 1) { currentStep++; $(this).closest('fieldset').next().fadeIn('slow'); $(this).closest('fieldset').css('display', 'none'); updateProgress(); } }); // PREVIOUS Button Click $(".progress-fieldset .prev_btn").on('click', function () { if (currentStep > 0) { currentStep--; $(this).closest('fieldset').prev().fadeIn('slow'); $(this).closest('fieldset').css('display', 'none'); updateProgress(); } }); // Initialize progress on page load updateProgress(); } if ($('.fieldset-wizard').length > 0) { $(".fieldset-wizard .next_btn").on('click', function () { // Function Runs On NEXT Button Click $(this).closest('fieldset').next().fadeIn('slow').css({ 'display': 'flex' }); $(this).closest('fieldset').css({ 'display': 'none' }); // Adding Class Active To Show Steps Forward; $('.wizard-progress .active').removeClass('active').addClass('activated').next().addClass('active'); }); $(".fieldset-wizard .prev_btn").on('click', function () { // Function Runs On NEXT Button Click $(this).closest('fieldset').prev().fadeIn('slow').css({ 'display': 'flex' }); $(this).closest('fieldset').css({ 'display': 'none' }); // Adding Class Active To Show Steps Forward; $('.wizard-progress .active').removeClass('active').prev().removeClass('activated').addClass('active'); }); } }); // Datetimepicker if ($('.datepic').length > 0) { $('.datepic').datetimepicker({ format: 'DD-MM-YYYY', keepOpen: true, inline: true, inline: true, icons: { up: "fas fa-angle-up", down: "fas fa-angle-down", next: 'fas fa-angle-right', previous: 'fas fa-angle-left' } }); } // Select 2 if ($('.select').length > 0) { $('.select').select2({ minimumResultsForSearch: -1, width: '100%' }); } // Create Service Wizard $(document).ready(function () { /*---------------------------------------------------------*/ $(".service-inform-fieldset .next_btn").on('click', function () { // Function Runs On NEXT Button Click $(this).closest('fieldset').next().fadeIn('slow'); $(this).closest('fieldset').css({ 'display': 'none' }); // Adding Class Active To Show Steps Forward; $('#progressbar .active').removeClass('active').addClass('activated').next().addClass('active'); }); $(".service-inform-fieldset .prev_btn").on('click', function () { // Function Runs On NEXT Button Click $(this).closest('fieldset').prev().fadeIn('slow'); $(this).closest('fieldset').css({ 'display': 'none' }); // Adding Class Active To Show Steps Forward; $('#progressbar .active').removeClass('active').prev().removeClass('activated').addClass('active'); }); }); // Edit Availability $(document).ready(function () { /*---------------------------------------------------------*/ $("#edit-availability .next_btn").on('click', function () { // Function Runs On NEXT Button Click $(this).closest('fieldset').next().fadeIn('slow'); $(this).closest('fieldset').css({ 'display': 'none' }); // Adding Class Active To Show Steps Forward; $('#progress-list .active').removeClass('active').addClass('activated').next().addClass('active'); }); $("#edit-availability .prev_btn").on('click', function () { // Function Runs On NEXT Button Click $(this).closest('fieldset').prev().fadeIn('slow'); $(this).closest('fieldset').css({ 'display': 'none' }); // Adding Class Active To Show Steps Forward; $('#progress-list .active').removeClass('active').prev().removeClass('activated').addClass('active'); }); }); // Multiple Image if ($('.multiple-img').length > 0) { function formatState(state) { if (!state.id) { return state.text; } var $state = $( '