(function($) { "use strict"; // Stick Sidebar if ($(window).width() > 767) { if($('.theiaStickySidebar').length > 0) { $('.theiaStickySidebar').theiaStickySidebar({ // Settings additionalMarginTop: 30 }); } } // 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(); } // Textarea Text Count var maxLength = 100; $('#review_desc').on('keyup change', function () { var length = $(this).val().length; length = maxLength-length; $('#chars').text(length); }); // Select 2 if ($('.select').length > 0) { $('.select').select2({ minimumResultsForSearch: -1, width: '100%' }); } // Date Time Picker if($('.datetimepicker').length > 0) { $('.datetimepicker').datetimepicker({ format: 'DD/MM/YYYY', icons: { up: "fas fa-chevron-up", down: "fas fa-chevron-down", next: 'fas fa-chevron-right', previous: 'fas fa-chevron-left' } }); } if($('.yearpicker').length > 0) { $('.yearpicker').datetimepicker({ format: 'YYYY', icons: { up: "fas fa-chevron-up", down: "fas fa-chevron-down", next: 'fas fa-chevron-right', previous: 'fas fa-chevron-left' } }); } // Floating Label if($('.floating').length > 0 ){ $('.floating').on('focus blur', function (e) { $(this).parents('.form-focus').toggleClass('focused', (e.type === 'focus' || this.value.length > 0)); }).trigger('blur'); } // Mobile menu sidebar overlay $('body').append(''); $(document).on('click', '#mobile_btn', function() { $('main-wrapper').toggleClass('slide-nav'); $('.sidebar-overlay').toggleClass('opened'); $('html').addClass('menu-opened'); return false; }); $(document).on('click', '.sidebar-overlay', function() { $('html').removeClass('menu-opened'); $(this).removeClass('opened'); $('main-wrapper').removeClass('slide-nav'); }); $(document).on('click', '#menu_close', function() { $('html').removeClass('menu-opened'); $('.sidebar-overlay').removeClass('opened'); $('main-wrapper').removeClass('slide-nav'); }); // Tooltip if($('[data-bs-toggle="tooltip"]').length > 0 ){ var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')) var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) { return new bootstrap.Tooltip(tooltipTriggerEl) }) } if($('[data-bs-toggle="popover"]').length > 0 ){ var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]')) var popoverList = popoverTriggerList.map(function (popoverTriggerEl) { return new bootstrap.Popover(popoverTriggerEl) }) } // Add More Hours $(".hours-info").on('click','.trash', function () { $(this).closest('.hours-cont').remove(); return false; }); $(".add-hours").on('click', function () { var hourscontent = '
' + '
' + '
' + '
' + '
' + '' + '' + '
' + '
' + '
' + '
' + '' + '' + '
' + '
' + '
' + '
' + '
' + '
'; $(".hours-info").append(hourscontent); return false; }); // Content div min height set function resizeInnerDiv() { var height = $(window).height(); var header_height = $(".header").height(); var footer_height = $(".footer").height(); var setheight = height - header_height; var trueheight = setheight - footer_height; $(".content").css("min-height", trueheight); } if($('.content').length > 0 ){ resizeInnerDiv(); } $(window).resize(function(){ if($('.content').length > 0 ){ resizeInnerDiv(); } }); // Slick Slider if($('.specialities-slider').length > 0) { $('.specialities-slider').slick({ dots: true, autoplay:false, infinite: true, variableWidth: true, prevArrow: false, nextArrow: false }); } if($('.testimonial-slider').length > 0) { $('.testimonial-slider').slick({ dots: true, autoplay:false, infinite: true, prevArrow: false, nextArrow: false, slidesToShow: 3, slidesToScroll: 1, responsive: [{ breakpoint: 992, settings: { slidesToShow: 3 } }, { breakpoint: 776, settings: { slidesToShow: 2 } }, { breakpoint: 567, settings: { slidesToShow: 1 } }] }); } if($('.doctor-slider').length > 0) { $('.doctor-slider').slick({ dots: false, autoplay:false, infinite: true, variableWidth: true, }); } if($('.doctor-sliders').length > 0 ){ var owl = $('.doctor-sliders'); owl.owlCarousel({ margin: 30, dots : false, nav: true, loop: true, responsive: { 0: { items: 1 }, 768 : { items: 2 }, 1170: { items: 4 } } }); } if($('.brand-sliders').length > 0 ){ var owl = $('.brand-sliders'); owl.owlCarousel({ margin: 30, dots : false, nav: true, loop: true, navContainer: '.slide-nav-10', navText: [ '', '' ], responsive: { 0: { items: 1 }, 768 : { items: 2 }, 1170: { items: 4 } } }); } if($('.deals-sliders').length > 0 ){ var owl = $('.deals-sliders'); owl.owlCarousel({ margin: 30, dots : false, nav: true, loop: true, navContainer: '.slide-nav-9', navText: [ '', '' ], responsive: { 0: { items: 1 }, 991 : { items: 2 }, 1170: { items: 2 } } }); } if($('.client-slider').length > 0) { $('.client-slider').slick({ dots: false, autoplay:false, infinite: true, slidesToShow: 3, slidesToScroll: 3, responsive: [ { breakpoint: 991, settings: { slidesToShow: 2, slidesToScroll: 2, } }, { breakpoint: 767, settings: { slidesToShow: 1, slidesToScroll: 1 } } ] }); } if($('.pro-slider').length > 0) { $('.pro-slider').slick({ dots: false, arrows: false, autoplay:false, infinite: true, slidesToShow: 4, slidesToScroll: 1, responsive: [ { breakpoint: 991, settings: { slidesToShow: 2, slidesToScroll: 2, } }, { breakpoint: 767, settings: { slidesToShow: 1, slidesToScroll: 1 } } ] }); } $('a[data-bs-toggle="tab"]').on('shown.bs.tab', function (e) { $('.pro-slider').slick('setPosition'); }) if($('.features-slider').length > 0) { $('.features-slider').slick({ dots: true, infinite: true, centerMode: true, slidesToShow: 3, speed: 500, variableWidth: true, arrows: false, autoplay:false, responsive: [{ breakpoint: 992, settings: { slidesToShow: 1 } }] }); } // Slick Slider if($('.features-slider1').length == 1) { $('.features-slider1').slick({ dots: false, infinite: true, centerMode: false, slidesToShow: 1, speed: 500, variableWidth: true, arrows: true, autoplay:false, responsive: [{ breakpoint: 992, settings: { slidesToShow: 1 } }] }); } if($('.slider-1').length > 0) { $('.slider-1').slick(); } if($('.pharm-slider').length > 0) { $('.pharm-slider').slick({ dots: true, autoplay:false, infinite: true, prevArrow: false, nextArrow: false, slidesToShow: 1, slidesToScroll: 1, responsive: [ { breakpoint: 991, settings: { slidesToShow: 1, slidesToScroll: 1, } } ] }); } //Home pharmacy slider if($('.dot-slider').length > 0) { $('.dot-slider').slick({ dots: true, autoplay:false, infinite: true, slidesToShow: 1, slidesToScroll: 1, arrows: false, responsive: [{ breakpoint: 992, settings: { slidesToShow: 1 } }, { breakpoint: 800, settings: { slidesToShow: 1 } }, { breakpoint: 776, settings: { slidesToShow: 1 } }, { breakpoint: 567, settings: { slidesToShow: 1 } }] }); } //clinic slider if($('.clinic-slider').length > 0) { $('.clinic-slider').slick({ dots: false, autoplay:false, infinite: true, slidesToShow: 4, slidesToScroll: 1, rows: 2, responsive: [{ breakpoint: 992, settings: { slidesToShow: 3 } }, { breakpoint: 800, settings: { slidesToShow: 3 } }, { breakpoint: 776, settings: { slidesToShow: 3 } }, { breakpoint: 567, settings: { slidesToShow: 1 } }] }); } //browse slider if($('.browse-slider').length > 0) { $('.browse-slider').slick({ dots: false, autoplay:false, infinite: true, slidesToShow: 4, slidesToScroll: 1, rows: 2, responsive: [{ breakpoint: 992, settings: { slidesToShow: 3 } }, { breakpoint: 800, settings: { slidesToShow: 3 } }, { breakpoint: 776, settings: { slidesToShow: 3 } }, { breakpoint: 567, settings: { slidesToShow: 1 } }] }); } //book doctor slider if($('.book-slider').length > 0) { $('.book-slider').slick({ dots: false, autoplay:false, infinite: true, slidesToShow: 4, slidesToScroll: 1, responsive: [{ breakpoint: 992, settings: { slidesToShow: 3 } }, { breakpoint: 800, settings: { slidesToShow: 3 } }, { breakpoint: 776, settings: { slidesToShow: 2 } }, { breakpoint: 567, settings: { slidesToShow: 1 } }] }); } //avalable features slider if($('.aval-slider').length > 0) { $('.aval-slider').slick({ dots: false, autoplay:false, infinite: true, slidesToShow: 3, slidesToScroll: 1, responsive: [{ breakpoint: 992, settings: { slidesToShow: 2 } }, { breakpoint: 800, settings: { slidesToShow: 2 } }, { breakpoint: 776, settings: { slidesToShow: 2 } }, { breakpoint: 567, settings: { slidesToShow: 1 } }] }); } //Home pharmacy slider if($('.pharmacy-home-slider .swiper-container').length > 0) { var swiper = new Swiper('.pharmacy-home-slider .swiper-container', { loop: true, speed: 1000, pagination: { el: '.pharmacy-home-slider .swiper-pagination', dynamicBullets: true, clickable: true, }, navigation: { nextEl: '.pharmacy-home-slider .swiper-button-next', prevEl: '.pharmacy-home-slider .swiper-button-prev', }, }); } // Date Range Picker if($('.bookingrange').length > 0) { var start = moment().subtract(6, 'days'); var end = moment(); function booking_range(start, end) { $('.bookingrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY')); } $('.bookingrange').daterangepicker({ startDate: start, endDate: end, ranges: { 'Today': [moment(), moment()], 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], 'Last 7 Days': [moment().subtract(6, 'days'), moment()], 'Last 30 Days': [moment().subtract(29, 'days'), moment()], 'This Month': [moment().startOf('month'), moment().endOf('month')], 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')] } }, booking_range); booking_range(start, end); } //Increment Decrement Numberes var quantitiy=0; $('.quantity-right-plus').click(function(e){ e.preventDefault(); var quantity = parseInt($('#quantity').val()); $('#quantity').val(quantity + 1); }); $('.quantity-left-minus').click(function(e){ e.preventDefault(); var quantity = parseInt($('#quantity').val()); if(quantity>0){ $('#quantity').val(quantity - 1); } }); //Cart Click $("#cart").on("click", function(o) { o.preventDefault(); $(".shopping-cart").fadeToggle(); $(".shopping-cart").toggleClass('show-cart'); }); // Circle Progress Bar function animateElements() { $('.circle-bar1').each(function () { var elementPos = $(this).offset().top; var topOfWindow = $(window).scrollTop(); var percent = $(this).find('.circle-graph1').attr('data-percent'); var animate = $(this).data('animate'); if (elementPos < topOfWindow + $(window).height() - 30 && !animate) { $(this).data('animate', true); $(this).find('.circle-graph1').circleProgress({ value: percent / 100, size : 400, thickness: 30, fill: { color: '#da3f81' } }); } }); $('.circle-bar2').each(function () { var elementPos = $(this).offset().top; var topOfWindow = $(window).scrollTop(); var percent = $(this).find('.circle-graph2').attr('data-percent'); var animate = $(this).data('animate'); if (elementPos < topOfWindow + $(window).height() - 30 && !animate) { $(this).data('animate', true); $(this).find('.circle-graph2').circleProgress({ value: percent / 100, size : 400, thickness: 30, fill: { color: '#68dda9' } }); } }); $('.circle-bar3').each(function () { var elementPos = $(this).offset().top; var topOfWindow = $(window).scrollTop(); var percent = $(this).find('.circle-graph3').attr('data-percent'); var animate = $(this).data('animate'); if (elementPos < topOfWindow + $(window).height() - 30 && !animate) { $(this).data('animate', true); $(this).find('.circle-graph3').circleProgress({ value: percent / 100, size : 400, thickness: 30, fill: { color: '#1b5a90' } }); } }); } if($('.circle-bar').length > 0) { animateElements(); } $(window).scroll(animateElements); // Preloader $(window).on('load', function () { if($('#loader').length > 0) { $('#loader').delay(350).fadeOut('slow'); $('body').delay(350).css({ 'overflow': 'visible' }); } }) //owl carousel if($('.owl-carousel.clinics').length > 0) { $('.owl-carousel.clinics').owlCarousel({ loop:true, margin:15, dots: false, nav:true, navContainer: '.slide-nav-1', navText: [ '', '' ], responsive:{ 0:{ items:1 }, 500:{ items:1 }, 768:{ items:3 }, 1000:{ items:4 }, 1300:{ items:6 } } }) } if($('.owl-carousel.our-doctors').length > 0) { $('.owl-carousel.our-doctors').owlCarousel({ loop:true, margin:15, dots: false, nav:true, navContainer: '.slide-nav-2', navText: [ '', '' ], responsive:{ 0:{ items:1 }, 500:{ items:1 }, 768:{ items:2 }, 1000:{ items:3 }, 1300:{ items:4 } } }) } if($('.owl-carousel.clinic-feature').length > 0) { $('.owl-carousel.clinic-feature').owlCarousel({ loop:true, margin:15, dots: false, nav:true, navContainer: '.slide-nav-3', navText: [ '', '' ], responsive:{ 0:{ items:1 }, 500:{ items:1 }, 768:{ items:3 }, 1000:{ items:4 }, 1300:{ items:5 } } }) } if($('.owl-carousel.blogs').length > 0) { $('.owl-carousel.blogs').owlCarousel({ loop:true, margin:15, dots: false, nav:true, navContainer: '.slide-nav-4', navText: [ '', '' ], responsive:{ 0:{ items:1 }, 500:{ items:1 }, 768:{ items:2 }, 1000:{ items:3 }, 1300:{ items:4 } } }) } //report card slider if($('.owl-carousel.report-card-slider').length > 0) { $('.owl-carousel.report-card-slider').owlCarousel({ loop:true, margin:10, nav:true, navText : ["",""], responsive:{ 0:{ items:1 }, 600:{ items:1 }, 1000:{ items:1 } } }) } //header-fixed if($('.header-trans').length > 0) { $(document).ready(function(){ $(window).scroll(function(){ var scroll = $(window).scrollTop(); if (scroll > 95) { $(".header-trans").css("background" , "#FFFFFF"); } else{ $(".header-trans").css("background" , "transparent"); } }) }) } if($('.header-trans-two').length > 0) { $(document).ready(function(){ $(window).scroll(function(){ var scroll = $(window).scrollTop(); if (scroll > 95) { $(".header-trans-two").css("background" , "#E5F1FB"); } else{ $(".header-trans-two").css("background" , "#FFFFFF"); } }) }) } if($('.header-trans.custom').length > 0) { $(document).ready(function(){ $(window).scroll(function(){ var scroll = $(window).scrollTop(); if (scroll > 95) { $(".header-trans").css("background" , "#2b6ccb"); } else{ $(".header-trans").css("background" , "transparent"); } }) }) } //BMI Status if($('#bmi-status').length > 0) { var options = { series: [{ name: "BMI", data: [10, 41, 35, 51, 49, 62, 69, 91, 148] }], chart: { height: 350, type: 'line', zoom: { enabled: false } }, dataLabels: { enabled: false }, stroke: { curve: 'straight' }, title: { align: 'left' }, grid: { row: { colors: ['#f3f3f3', 'transparent'], // takes an array which will be repeated on columns opacity: 0.5 }, }, xaxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep'], } }; var chart = new ApexCharts(document.querySelector("#bmi-status"), options); chart.render(); } //Heart Rate Status if($('#heartrate-status').length > 0) { var options = { series: [{ name: 'HeartRate', data: [4, 3, 10, 9, 29, 19, 22, 9, 12, 7, 19, 5, 13, 9, 17, 2, 7, 5] }], chart: { height: 350, type: 'line', }, stroke: { width: 7, curve: 'smooth' }, xaxis: { type: 'datetime', categories: ['1/11/2000', '2/11/2000', '3/11/2000', '4/11/2000', '5/11/2000', '6/11/2000', '7/11/2000', '8/11/2000', '9/11/2000', '10/11/2000', '11/11/2000', '12/11/2000', '1/11/2001', '2/11/2001', '3/11/2001','4/11/2001' ,'5/11/2001' ,'6/11/2001'], tickAmount: 10, }, title: { align: 'left', }, fill: { type: 'gradient', gradient: { shade: 'dark', gradientToColors: [ '#0de0fe'], shadeIntensity: 1, type: 'horizontal', opacityFrom: 1, opacityTo: 1, stops: [0, 100, 100, 100] }, }, markers: { size: 4, colors: ["#15558d"], strokeColors: "#fff", strokeWidth: 2, hover: { size: 7, } }, yaxis: { min: -10, max: 40, title: { }, } }; var chart = new ApexCharts(document.querySelector("#heartrate-status"), options); chart.render(); } //FBC Status if($('#fbc-status').length > 0) { var options = { series: [{ name: 'FBC', data: [2.3, 3.1, 4.0, 10.1, 4.0, 3.6, 3.2, 2.3, 1.4, 0.8, 0.5, 0.2] }], chart: { height: 350, type: 'bar', }, plotOptions: { bar: { borderRadius: 10, dataLabels: { position: 'top', // top, center, bottom }, } }, dataLabels: { enabled: true, formatter: function (val) { return val + "%"; }, offsetY: -20, style: { fontSize: '12px', colors: ["#304758"] } }, xaxis: { categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], position: 'top', axisBorder: { show: false }, axisTicks: { show: false }, crosshairs: { fill: { type: 'gradient', gradient: { colorFrom: '#0de0fe', colorTo: '#0de0fe', stops: [0, 100], opacityFrom: 0.4, opacityTo: 0.5, } } }, tooltip: { enabled: true, } }, yaxis: { axisBorder: { show: false }, axisTicks: { show: false, }, labels: { show: false, formatter: function (val) { return val + "%"; } } }, title: { floating: true, offsetY: 330, align: 'center', style: { color: '#444' } } }; var chart = new ApexCharts(document.querySelector("#fbc-status"), options); chart.render(); } //Weight Status if($('#weight-status').length > 0) { var options = { series: [{ name: 'Weight', data: [34, 44, 54, 21, 12, 43, 33, 23, 66, 66, 58] }], chart: { type: 'line', height: 350 }, stroke: { curve: 'stepline', }, dataLabels: { enabled: false }, title: { align: 'left' }, markers: { hover: { sizeOffset: 4 } } }; var chart = new ApexCharts(document.querySelector("#weight-status"), options); chart.render(); } // Signup Toggle $(function () { $("#is_registered").click(function () { if ($(this).is(":checked")) { $("#preg_div").show(); } else { $("#preg_div").hide(); } }); }); //Increment Decrement value $('.inc.button').click(function(){ var $this = $(this), $input = $this.prev('input'), $parent = $input.closest('div'), newValue = parseInt($input.val())+1; $parent.find('.inc').addClass('a'+newValue); $input.val(newValue); newValue += newValue; }); $('.dec.button').click(function(){ var $this = $(this), $input = $this.next('input'), $parent = $input.closest('div'), newValue = parseInt($input.val())-1; console.log($parent); $parent.find('.inc').addClass('a'+newValue); $input.val(newValue); newValue += newValue; }); // Signup Profile function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#prof-avatar').attr('src', e.target.result); }; reader.readAsDataURL(input.files[0]); } } $("#profile_image").change(function() { readURL(this); }); // Datepicker var maxDate = $('#maxDate').val(); if($('#dob').length > 0) { $('#dob').datepicker({ startView: 2, format: 'dd/mm/yyyy', autoclose: true, todayHighlight: true, endDate: maxDate }); } if($('#editdob').length > 0) { $('#editdob').datepicker({ startView: 2, format: 'dd/mm/yyyy', autoclose: true, todayHighlight: true, endDate: maxDate }); } // Doctor Slider if($('.doctor-book-slider').length > 0) { $('.doctor-book-slider').slick({ dots: false, autoplay:false, infinite: true, slidesToShow: 4, slidesToScroll: 1, responsive: [{ breakpoint: 992, settings: { slidesToShow: 3 } }, { breakpoint: 800, settings: { slidesToShow: 3 } }, { breakpoint: 776, settings: { slidesToShow: 2 } }, { breakpoint: 567, settings: { slidesToShow: 1 } }] }); } // Features Slider if($('.features-section-slider').length > 0) { $('.features-section-slider').slick({ dots: false, autoplay:false, infinite: true, slidesToShow: 4, slidesToScroll: 1, responsive: [{ breakpoint: 1199, settings: { slidesToShow: 3 } }, { breakpoint: 992, settings: { slidesToShow: 3 } }, { breakpoint: 860, settings: { slidesToShow: 2 } }, { breakpoint: 776, settings: { slidesToShow: 2 } }, { breakpoint: 567, settings: { slidesToShow: 1 } }] }); } //Banner Three Slider var $status = $('.slider-counter-three'); var $slickElement = $('.home-banner-three-slider'); $slickElement.on('init reInit afterChange', function (event, slick, currentSlide, nextSlide) { if(!slick.$dots){ return; } var i = (currentSlide ? currentSlide : 0) + 1; $status.text(i + '/' + (slick.$dots[0].children.length)); }); if($('.home-banner-three-slider').length > 0) { $slickElement.slick({ autoplay:false, infinite: false, slidesToShow: 1, slidesToScroll: 1, autoplay: true, dots: true }); } // AOS Animation if($('.main-wrapper .aos').length > 0) { AOS.init({ duration: 1200, once: true, }); } // Favourite Btn $('.doctor-fav-btn .fav-icon').on('click', function () { $(this).toggleClass('favourite'); }); // Doctor Slider if($('.best-doctor-slider').length > 0) { $('.best-doctor-slider').slick({ dots: false, autoplay:false, infinite: true, slidesToShow: 4, slidesToScroll: 1, responsive: [{ breakpoint: 992, settings: { slidesToShow: 3 } }, { breakpoint: 800, settings: { slidesToShow: 2 } }, { breakpoint: 776, settings: { slidesToShow: 2 } }, { breakpoint: 567, settings: { slidesToShow: 1 } }] }); } // Home Banner Three if($('.owl-carousel.home-three-slider').length > 0) { $('.owl-carousel.home-three-slider').owlCarousel({ loop:true, dots: true, nav:true, responsive:{ 0:{ items:1 }, 500:{ items:1 }, 768:{ items:1 }, 1000:{ items:1 }, 1300:{ items:1 } } }) } // Best Our Doctors Slider if($('.owl-carousel.best-our-doctors').length > 0) { $('.owl-carousel.best-our-doctors').owlCarousel({ loop:true, margin:15, dots: false, nav:true, navContainer: '.slide-nav-5', navText: [ '', '' ], responsive:{ 0:{ items:1 }, 500:{ items:1 }, 768:{ items:2 }, 1000:{ items:3 }, 1300:{ items:4 } } }) } // Features Clinic Slider if($('.owl-carousel.features-clinic-slider').length > 0) { $('.owl-carousel.features-clinic-slider').owlCarousel({ loop:true, margin:15, dots: false, nav:true, navContainer: '.slide-nav-6', navText: [ '', '' ], responsive:{ 0:{ items:1 }, 500:{ items:1 }, 768:{ items:2 }, 1000:{ items:3 }, 1300:{ items:4 } } }) } // Latest Blog Slider if($('.owl-carousel.latest-blog-slider').length > 0) { $('.owl-carousel.latest-blog-slider').owlCarousel({ loop:true, margin:10, dots: false, nav:true, navContainer: '.slide-nav-7', navText: [ '', '' ], responsive:{ 0:{ items:1 }, 500:{ items:1 }, 768:{ items:2 }, 1000:{ items:3 }, 1300:{ items:3 } } }) } // Best Doctors Slider if($('.best-doctors-slider').length > 0) { $('.best-doctors-slider').slick({ dots: true, autoplay:false, infinite: true, slidesToShow: 4, slidesToScroll: 1, responsive: [{ breakpoint: 992, settings: { slidesToShow: 3 } }, { breakpoint: 800, settings: { slidesToShow: 3 } }, { breakpoint: 776, settings: { slidesToShow: 2 } }, { breakpoint: 567, settings: { slidesToShow: 1 } }] }); } // Features Clinic Four if($('.owl-carousel.features-clinic-slider-four').length > 0) { $('.owl-carousel.features-clinic-slider-four').owlCarousel({ loop:true, margin:15, dots: false, nav:true, navContainer: '.slide-nav-8', navText: [ '', '' ], responsive:{ 0:{ items:1 }, 500:{ items:1 }, 768:{ items:2 }, 1000:{ items:3 }, 1300:{ items:3 } } }) } // Scroll Down $('a.smooth-menu').on('click', function(e) { var $anchor = $(this); $('html, body').stop().animate({ scrollTop: $($anchor.attr('href')).offset().top}); e.preventDefault(); }); // Home Banner Two Slider Arrow Position var window_width = $(window).outerWidth(); var container_width = $('.container').outerWidth(); var full_width = window_width - container_width var right_position_value = full_width / 2 $('.banner-two-slider .slider-counter').css('right', right_position_value); $('.banner-two-slider .slick-next').css('right', right_position_value + 10); $('.banner-two-slider .slick-prev').css('right', right_position_value + 150); // Home Banner Three Slider Arrow Position var window_width = $(window).outerWidth(); var container_width = $('.container').outerWidth(); var full_width = window_width - container_width var right_position_value = full_width / 2 $('.home-three-slider .owl-dots').css('right', right_position_value + 43); $('.home-three-slider .owl-next').css('right', right_position_value + 10); $('.home-three-slider .owl-prev').css('right', right_position_value + 150); // Slick Slider if($('.onboard-slider').length > 0) { $('#onboard-slider').owlCarousel({ items: 1, margin: 30, dots : true, nav: true, navText: false, loop: true, smartSpeed:450, autoplay:true, autoplayTimeout:5000, autoplayHoverPause:true, responsiveClass:true, responsive: { 0: { items: 1 }, 768 : { items: 1 }, 1170: { items: 1 } } }); } // Price Slider if($('#price-range').length > 0) { $('#pricerangemin').text(1); $('#pricerangemax').text(500); $("#price-range").slider({ range: true, min: 1, max: 500, values: [ 0, 500 ], slide: function( event, ui ) { $( "#pricerangemin" ).text( ui.values[ 0 ] ); $( "#pricerangemax" ).text( ui.values[ 1 ] ); } }); } //Otp verfication $('.digit-group').find('input').each(function() { $(this).attr('maxlength', 1); $(this).on('keyup', function(e) { var parent = $($(this).parent()); if(e.keyCode === 8 || e.keyCode === 37) { var prev = parent.find('input#' + $(this).data('previous')); if(prev.length) { $(prev).select(); } } else if((e.keyCode >= 48 && e.keyCode <= 57) || (e.keyCode >= 65 && e.keyCode <= 90) || (e.keyCode >= 96 && e.keyCode <= 105) || e.keyCode === 39) { var next = parent.find('input#' + $(this).data('next')); if(next.length) { $(next).select(); } else { if(parent.data('autosubmit')) { parent.submit(); } } } }); }); $('.digit-group input').on('keyup', function(){ var self = $(this); if ( self.val() != '' ) { self.addClass('active'); } else { self.removeClass('active'); } }); $(".tog-button").click(function(){ $(".tog-button span").animate({right: '4px'}); }); // Image file upload image function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#blah').attr('src', e.target.result); $('.upload-pic h6').hide(); } reader.readAsDataURL(input.files[0]); } } $("#imgInp").change(function(){ readURL(this); }); //Gender Logic $("#test1").change(function(){ if( $(this).is(":checked") ){ $('.pregnant-col').hide(); } }); $("#test2").change(function(){ if( $(this).is(":checked") ){ $('.pregnant-col').show(); } }); // Link Change $("#radio2").change(function(){ if( $(this).is(":checked") ){ $("#change-url").attr("href", "onboarding-email.html"); } }); $("#radio1").change(function(){ if( $(this).is(":checked") ){ $("#change-url").attr("href", "onboarding-phone.html"); } }); $('#change-url').on('click', function(e) { if($('#radio1').is(":not(:checked)") && $('#radio2').is(":not(:checked)") ){ alert('please select any one verify method!!!'); } }); // simple close btn $("#document-name").click(function(){ $('.upload-sucess-note h6:nth-child(2)').fadeOut().hide(400); }); $(document).ready(function() { if($('.gallery-grid').length > 0 ){ var projects = $('.gallery-photos'); var filteredProjects = []; var selection = "all"; var running = false; window.setTimeout(function() { $('.all').trigger('click'); }, 150); $(window).resize(function() { buildGrid(filteredProjects); }); $('.category-buttons a').on('click', function(e) { e.preventDefault(); if (!running) { running = true; selection = $(this).data('group'); $('.category-buttons a').removeClass('active'); $(this).addClass('active'); filteredProjects = []; for (let i = 0; i < projects.length; i++) { var project = projects[i]; var dataString = $(project).data('groups'); var dataArray = dataString.split(','); dataArray.pop(); if (selection === 'all') { $(project).addClass('setScale').queue(function(next) { filteredProjects.push(project); next(); }).queue(function(next) { $(this).removeClass('setScale'); next(); }).queue(function(next) { $(this).addClass('animating show') next(); }).delay(750).queue(function() { running = false; $(this).removeClass('animating').dequeue(); }); } else { if ($.inArray(selection, dataArray) > -1) { $(project).addClass('setScale').queue(function(next) { filteredProjects.push(project); next(); }).queue(function(next) { $(this).removeClass('setScale'); next(); }).queue(function(next) { $(this).addClass('animating show') next(); }).delay(750).queue(function() { running = false; $(this).removeClass('animating').dequeue(); }); /*$(project).css({ '-webkit-transition': 'all 750ms cubic-bezier(0.175, 0.885, 0.32, 1.1)', 'transition': 'all 750ms cubic-bezier(0.175, 0.885, 0.32, 1.1);', '-webkit-transform': 'scale(' + 1 + ')', '-ms-transform': 'scale(' + 1 + ')', 'transform': 'scale(' + 1 + ')', 'opacity': 1 });*/ } else { $(project).queue(function(next) { $(this).addClass('animating'); next(); }).queue(function(next) { $(this).removeClass('show'); next(); }).delay(750).queue(function() { $(this).removeClass('animating').dequeue(); }); /*$(project).css({ '-webkit-transition': 'all 750ms cubic-bezier(0.175, 0.885, 0.32, 1.1)', 'transition': 'all 750ms cubic-bezier(0.175, 0.885, 0.32, 1.1);', '-webkit-transform': 'scale(' + 0 + ')', '-webkit-transform': 'scale(' + 0 + ')', '-ms-transform': 'scale(' + 0 + ')', 'transform': 'scale(' + 0 + ')', 'opacity': 0 });*/ } } } buildGrid(filteredProjects); } }) function buildGrid(projects) { var left = 0; var top = 0; var totalHeight = 0; var largest = 0; var heights = []; for (let i = 0; i < projects.length; i++) { $(projects[i]).css({ height: 'auto' }); heights.push($(projects[i]).height()); } var maxIndex = 0; var maxHeight = 0; for (let i = 0; i <= heights.length; i++) { if (heights[i] > maxHeight) { maxHeight = heights[i]; maxIndex = i; $('.guide').height(maxHeight); } if (i === heights.length) { for (i = 0; i < projects.length; i++) { $(projects[i]).css({ position: 'absolute', left: left + '%', top: top }); left = left + ($('.guide').width() / $('#gallery-grid').width() * 78.2); if (i === maxIndex) { $(projects[i]).css({ height: 'auto' }); } else { $(projects[i]).css({ height: maxHeight, }); } if ((i + 1) % 4 === 0 && projects.length > 4 && $(window).width() >= 700) { top = top + $('.guide').height() + 20; left = 0; totalHeight = totalHeight + $('.guide').height() + 20; } else if ((i + 1) % 2 === 0 && projects.length > 2 && $(window).width() < 700 && $(window).width() >= 480) { top = top + $('.guide').height() + 20; left = 0; totalHeight = totalHeight + $('.guide').height() + 20; } else if ((i + 1) % 1 === 0 && projects.length > 1 && $(window).width() < 480) { top = top + $('.guide').height() + 20; left = 0; totalHeight = totalHeight + $('.guide').height() + 20; } $('#gallery-grid').height(totalHeight + $('.guide').height()); } } } } } }); // Increment or Decrement $(".quantity-btn").on("click", function () { var $button = $(this); var oldValue = $button.closest('.product-quantity').find("input.quntity-input").val(); if ($button.text() == "+") { var newVal = parseFloat(oldValue) + 1; } else { if (oldValue > 0) { var newVal = parseFloat(oldValue) - 1; } else { newVal = 0; } } $button.closest('.product-quantity').find("input.quntity-input").val(newVal); }); // Favourite $('.deal-pro-tags .favourite-icon').on('click', function () { $(this).toggleClass('favourite'); }); })(jQuery);