File: /mnt/data/doccure-wp/wp-content/plugins/doccure-elementor/assets/js/elementor_preview_doccure.js
// Initialize AOS after the DOM is loaded
document.addEventListener('DOMContentLoaded', function () {
AOS.init({
duration: 1200, // Animation duration in milliseconds
once: true, // Only animate once
});
});
// Reinitialize AOS for Elementor Editor
if (typeof elementor !== 'undefined') {
elementor.hooks.addAction('frontend/element_ready', () => {
AOS.refresh();
});
}
(function ($) {
"use stict";
jQuery(document).ready(function ($) {
// Initialize AOS after the DOM is loaded
document.addEventListener('DOMContentLoaded', function () {
AOS.init({
duration: 1200, // Animation duration in milliseconds
once: true, // Only animate once
});
});
});
// Reinitialize AOS for Elementor Editor
if (typeof elementor !== 'undefined') {
elementor.hooks.addAction('frontend/element_ready', () => {
AOS.refresh();
});
}
jQuery(document).ready(function ($) {
// Check if the page is not being edited in Elementor
if (!$('body').hasClass('elementor-editor-active')) {
// Initialize AOS only if it's not Elementor editor
if ($('body .aos').length > 0) {
AOS.init({
duration: 1200,
once: true,
});
}
}
});
jQuery(document).ready(function ($) {
if ($('body .elementor-editor-active').length > 0) {
AOS.init({
duration: 1200,
once: true,
});
}
});
jQuery(document).ready(function ($) {
if ($('body .aos').length > 0) {
AOS.init({
duration: 1200,
once: true,
});
}
});
$(window).on('elementor/frontend/init', function () {
elementorFrontend.hooks.addAction('frontend/element_ready/shortcode.default', function () {
runSlickSlider();
});
elementorFrontend.hooks.addAction('frontend/element_ready/doccure-taxonomy-carousel.default', function () {
runSlickSlider();
});
elementorFrontend.hooks.addAction('frontend/element_ready/doccure-taxonomy-grid.default', function () {
runSlickSlider();
});
elementorFrontend.hooks.addAction('frontend/element_ready/doccure-woocommerce-products-carousel.default', function () {
runSlickSlider();
runListingCarousel();
});
elementorFrontend.hooks.addAction('frontend/element_ready/doccure-imagebox.default', function () {
runImageBoxes();
});
elementorFrontend.hooks.addAction('frontend/element_ready/doccure-listings-carouselNew.default', function () {
runListingCarouselNew();
});
elementorFrontend.hooks.addAction('frontend/element_ready/doccure-testimonials.default', function () {
runtestimonialCarouselNew();
});
elementorFrontend.hooks.addAction('frontend/element_ready/doccure-logo-slider.default', function () {
runlogosliderCarouselNew();
});
elementorFrontend.hooks.addAction('frontend/element_ready/Doccure_DoctorsSpecialitiesNew.default', function () {
runspcialityslider();
});
elementorFrontend.hooks.addAction('frontend/element_ready/DoctorsCarousel.default', function () {
doctorsslider();
});
elementorFrontend.hooks.addAction('frontend/element_ready/doccure-testimonials.default', function () {
testimonialsslider();
});
elementorFrontend.hooks.addAction('frontend/element_ready/doccure-clients.default', function () {
companyslider();
});
elementorFrontend.hooks.addAction('frontend/element_ready/doccure-listings-carousel.default', function () {
runListingCarousel();
});
elementorFrontend.hooks.addAction('frontend/element_ready/doccure-flip-banner.default', function () {
parallaxBG();
});
elementorFrontend.hooks.addAction('frontend/element_ready/doccure-accordion.default', function () {
parallaxBG();
});
elementorFrontend.hooks.addAction('frontend/element_ready/doccure-toggle.default', function () {
parallaxBG();
});
elementorFrontend.hooks.addAction('frontend/element_ready/doccure-flip-bannerabout.default', function () {
parallaxBG();
});
elementorFrontend.hooks.addAction('frontend/element_ready/doccure-testimonials.default', function () {
runTestimonials();
});
elementorFrontend.hooks.addAction('frontend/element_ready/doccure-logo-slider.default', function () {
runLogoSlider();
});
elementorFrontend.hooks.addAction('frontend/element_ready/doccure-homebanner.default', function () {
inlineCSS();
});
elementorFrontend.hooks.addAction('frontend/element_ready/doccure-homesearchslider.default', function () {
homecarousel();
});
});
function homecarousel(){
// New Carousel Nav With Arrows
$('.home-search-carousel, .simple-slick-carousel').append(""+
"<div class='slider-controls-container'>"+
"<div class='slider-controls'>"+
"<button type='button' class='slide-m-prev'></button>"+
"<div class='slide-m-dots'></div>"+
"<button type='button' class='slide-m-next'></button>"+
"</div>"+
"</div>");
// New Homepage Carousel
$('.home-search-carousel').slick({
slide: '.home-search-slide',
centerMode: true,
centerPadding: '15%',
slidesToShow: 1,
dots: true,
arrows: true,
appendDots: $(".home-search-carousel .slide-m-dots"),
prevArrow: $(".home-search-carousel .slide-m-prev"),
nextArrow: $(".home-search-carousel .slide-m-next"),
responsive: [
{
breakpoint: 1940,
settings: {
centerPadding: '13%',
slidesToShow: 1,
}
},
{
breakpoint: 1640,
settings: {
centerPadding: '8%',
slidesToShow: 1,
}
},
{
breakpoint: 1430,
settings: {
centerPadding: '50px',
slidesToShow: 1,
}
},
{
breakpoint: 1370,
settings: {
centerPadding: '20px',
slidesToShow: 1,
}
},
{
breakpoint: 767,
settings: {
centerPadding: '20px',
slidesToShow: 1
}
}
]
});
// New Homepage Carousel Positioning
$(".home-search-slider-headlines").each(function() {
var carouselHeadlineHeight = $(this).height();
$(this).css('padding-bottom', carouselHeadlineHeight + 30);
});
$('.home-search-carousel').removeClass('carousel-not-ready');
}
function runLogoSlider(){
$('.logo-slick-carousel').slick({
infinite: true,
slidesToShow: 5,
slidesToScroll: 4,
dots: true,
arrows: true,
responsive: [
{
breakpoint: 992,
settings: {
slidesToShow: 3,
slidesToScroll: 3
}
},
{
breakpoint: 769,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
]
});
}
function runImageBoxes(){
/*----------------------------------------------------*/
/* Image Box
/*----------------------------------------------------*/
$('.category-box').each(function(){
// add a photo container
$(this).append('<div class="category-box-background"></div>');
// set up a background image for each tile based on data-background-image attribute
$(this).children('.category-box-background').css({'background-image': 'url('+ $(this).attr('data-background-image') +')'});
});
/*----------------------------------------------------*/
/* Image Box
/*----------------------------------------------------*/
$('.img-box').each(function(){
$(this).append('<div class="img-box-background"></div>');
$(this).children('.img-box-background').css({'background-image': 'url('+ $(this).attr('data-background-image') +')'});
});
}
// Service slider
if($('.owl-carousel.service-slider').length > 0) {
$('.owl-carousel.service-slider').owlCarousel({
loop:true,
margin:24,
nav:true,
dots:false,
smartSpeed: 2000,
navText : ["<i class='fa-solid fa-angle-left'></i>","<i class='fa-solid fa-angle-right'></i>"],
navContainer: '.mynav',
responsive:{
0:{
items:1
},
550:{
items:2
},
700:{
items:2
},
1000:{
items:3
}
}
})
}
// Service slider
function runtestimonialCarouselNew() {
if($('.owl-carousel.testimonial-slider').length > 0) {
$('.owl-carousel.testimonial-slider').owlCarousel({
loop:true,
margin:24,
nav:true,
smartSpeed: 2000,
navText : ["<i class='fa-solid fa-angle-left'></i>","<i class='fa-solid fa-angle-right'></i>"],
responsive:{
0:{
items:1
},
700:{
items:2
},
1000:{
items:2
}
}
})
}
}
function runlogosliderCarouselNew() {
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
},
1000:{
items:6
}
}
})
}
}
function runspcialityslider() {
if($('.owl-carousel.spciality-slider').length > 0) {
$('.owl-carousel.spciality-slider').owlCarousel({
loop:true,
margin:24,
nav:false,
dots:false,
smartSpeed: 2000,
responsive:{
0:{
items:1
},
550:{
items:2
},
700:{
items:3
},
1000:{
items:6
}
}
})
}
}
function doctorsslider() {
if ($('.doctors-slider').length > 0) {
$('.doctors-slider').owlCarousel({
loop: true,
margin: 24,
dots: false,
nav: false,
smartSpeed: 2000,
navContainer: '.doctor-nav',
navText: ['<i class="isax isax-arrow-left"></i>', '<i class="isax isax-arrow-right-1"></i>'],
responsive: {
0: {
items: 1
},
768: {
items: 2
},
992: {
items: 3
},
1300: {
items: 4
}
}
})
}
}
function testimonialsslider() {
if ($('.testimonials-slider').length > 0) {
$('.testimonials-slider').owlCarousel({
loop: true,
margin: 24,
dots: false,
nav: false,
smartSpeed: 2000,
responsive: {
0: {
items: 1
},
768: {
items: 2
},
992: {
items: 3
}
}
})
}
}
function companyslider() {
if ($('.company-slider').length > 0) {
$('.company-slider').owlCarousel({
loop: true,
margin: 40,
dots: false,
nav: false,
smartSpeed: 2000,
autoplay: true,
responsive: {
0: {
items: 2
},
500: {
items: 3
},
768: {
items: 4
},
992: {
items: 6
},
1200: {
items: 8
}
}
})
}
}
function runListingCarouselNew() {
if($('.owl-carousel.service-slider').length > 0) {
$('.owl-carousel.service-slider').owlCarousel({
loop:true,
margin:24,
nav:true,
dots:false,
smartSpeed: 2000,
navText : ["<i class='fa-solid fa-angle-left'></i>","<i class='fa-solid fa-angle-right'></i>"],
responsive:{
0:{
items:1
},
550:{
items:2
},
700:{
items:2
},
1000:{
items:3
}
}
})
}
}
function runListingCarouselold() {
$('.simple-fw-slick-carousel').slick({
infinite: true,
slidesToShow: 5,
slidesToScroll: 1,
dots: true,
arrows: false,
responsive: [
{
breakpoint: 1610,
settings: {
slidesToShow: 4,
}
},
{
breakpoint: 1365,
settings: {
slidesToShow: 3,
}
},
{
breakpoint: 1024,
settings: {
slidesToShow: 2,
}
},
{
breakpoint: 767,
settings: {
slidesToShow: 1,
}
}
]
}).on("init", function(e, slick) {
console.log(slick);
});
$('.simple-slick-carousel').slick({
infinite: true,
slidesToShow: 3,
slidesToScroll: 3,
dots: true,
arrows: true,
responsive: [
{
breakpoint: 992,
settings: {
slidesToShow: 2,
slidesToScroll: 2
}
},
{
breakpoint: 769,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
]
}).on("init", function(e, slick) {
console.log(slick);
});
}
function parallaxBG() {
$('.parallax,.vc_parallax').prepend('<div class="parallax-overlay"></div>');
$('.parallax,.vc_parallax').each(function() {
var attrImage = $(this).attr('data-background');
var attrColor = $(this).attr('data-color');
var attrOpacity = $(this).attr('data-color-opacity');
if(attrImage !== undefined) {
$(this).css('background-image', 'url('+attrImage+')');
}
if(attrColor !== undefined) {
$(this).find(".parallax-overlay").css('background-color', ''+attrColor+'');
}
if(attrOpacity !== undefined) {
$(this).find(".parallax-overlay").css('opacity', ''+attrOpacity+'');
}
});
}
function runSlickSlider() {
$('.fullwidth-slick-carousel').slick({
centerMode: true,
centerPadding: '20%',
slidesToShow: 3,
dots: true,
arrows: false,
responsive: [
{
breakpoint: 1920,
settings: {
centerPadding: '15%',
slidesToShow: 3
}
},
{
breakpoint: 1441,
settings: {
centerPadding: '10%',
slidesToShow: 3
}
},
{
breakpoint: 1025,
settings: {
centerPadding: '10px',
slidesToShow: 2,
}
},
{
breakpoint: 767,
settings: {
centerPadding: '10px',
slidesToShow: 1
}
}
]
});
}
function runTestimonials(){
$('.testimonial-carousel').slick({
centerMode: true,
centerPadding: '34%',
slidesToShow: 1,
dots: true,
arrows: false,
responsive: [
{
breakpoint: 1025,
settings: {
centerPadding: '10px',
slidesToShow: 2,
}
},
{
breakpoint: 767,
settings: {
centerPadding: '10px',
slidesToShow: 1
}
}
]
});
}
function inlineCSS() {
// Common Inline CSS
$(".main-search-container, section.fullwidth, .listing-slider .item, .listing-slider-small .item, .address-container, .img-box-background, .image-edge, .edge-bg").each(function() {
var attrImageBG = $(this).attr('data-background-image');
var attrColorBG = $(this).attr('data-background-color');
if(attrImageBG !== undefined) {
$(this).css('background-image', 'url('+attrImageBG+')');
}
if(attrColorBG !== undefined) {
$(this).css('background', ''+attrColorBG+'');
}
});
}
})(jQuery);