1jQuery(document).ready(function () { 2 jQuery('.section-home-navigation .menu-div .single-div .img-div').matchHeight(); 3 jQuery('.section-home-navigation .menu-div .single-div').matchHeight(); 4 jQuery('.section-home-deals .deals-div .single-deal .text-div h3').matchHeight(); 5 //jQuery('.section-home-vouchers .vouchers-div .single-voucher .text-div h3').matchHeight(); 6 jQuery('.section-home-products .products-div .single-product .text-div h3').matchHeight(); 7 jQuery('.section-home-products .products-div .single-product .text-div').matchHeight(); 8 jQuery('.home-posts-div .right-div .slider-div .single-div .text-div').matchHeight(); 9 //jQuery('.section-sustainability-customers .middle-div .content-div .single-div h3').matchHeight(); 10 //jQuery('.section-sustainability-customers .middle-div .content-div .single-div p').matchHeight(); 11 //jQuery('.section-sustainability-customers .middle-div .content-div .single-div .inner-div').matchHeight(); 12 //jQuery('.section-sustainability-community .middle-div .row-div .single-div p').matchHeight(); 13 //jQuery('.section-sustainability-community .bottom-div .row-div .single-div .text-div').matchHeight(); 14 //jQuery('.section-sustainability-people .content-div .row-div .single-div .text-div').matchHeight(); 15 jQuery('.section-sustainability-caring .content-div .single-div .text-div').matchHeight(); 16 jQuery('.section-sustainability-caring .content-div .single-div .hover-div .layer-div .inner-div').matchHeight(); 17 jQuery('.section-corporate-detail-why .row-div .single-div').matchHeight(); 18 jQuery('.section-specialised-services-detail-how .row-div .single-div').matchHeight(); 19 jQuery('.section-best-deal-listing .deals-div .single-deal .text-div h3').matchHeight(); 20 jQuery('.section-best-deal-listing .deals-div .single-deal .text-div').matchHeight(); 21 jQuery('.latest-deals-div .single-div h3').matchHeight(); 22 jQuery('.section-health-talk-check .content-div .bottom-div .single-div').matchHeight(); 23 jQuery('.all-info-div .single-div h3').matchHeight(); 24 jQuery('.all-info-div .single-div .text-div').matchHeight(); 25 jQuery('.latest-health-info-div .single-div h3').matchHeight(); 26 jQuery('.latest-health-info-div .single-div .text-div').matchHeight(); 27 jQuery('.caring-news-listing .content-div .single-div').matchHeight(); 28 jQuery('.all-posts-div .single-div h3').matchHeight(); 29 jQuery('.all-posts-div .single-div p.excerpt').matchHeight(); 30 jQuery('footer .top-div .sidebar-column').matchHeight(); 31 32 jQuery('.section-home-hero .slider-div').slick({ 33 arrows:true, 34 dots:true, 35 slidesToShow: 1, 36 slidesToScroll: 1, 37 swipeToSlide: true, 38 infinite: true, 39 autoplay: true, 40 autoplaySpeed: 3000, 41 }); 42 43 jQuery('.section-home-deals .deals-div').slick({ 44 arrows:true, 45 dots:false, 46 slidesToShow: 3, 47 slidesToScroll: 3, 48 swipeToSlide: true, 49 infinite: false, 50 autoplay: true, 51 autoplaySpeed: 3000, 52 responsive: [ 53 { 54 breakpoint: 768, 55 settings: { 56 slidesToShow: 1, 57 slidesToScroll: 1 58 } 59 } 60 ] 61 }); 62 63 jQuery('.section-home-vouchers .vouchers-div').slick({ 64 arrows:true, 65 dots:false, 66 slidesToShow: 4, 67 slidesToScroll: 4, 68 swipeToSlide: true, 69 infinite: false, 70 autoplay: true, 71 autoplaySpeed: 3000, 72 responsive: [ 73 { 74 breakpoint: 768, 75 settings: { 76 slidesToShow: 1, 77 slidesToScroll: 1 78 } 79 } 80 ] 81 }); 82 83 /*jQuery('.milestones-div').slick({ 84 arrows:true, 85 dots:false, 86 slidesToShow: 1, 87 slidesToScroll: 1, 88 swipeToSlide: true, 89 infinite: false, 90 autoplay: true, 91 autoplaySpeed: 3000, 92 });*/ 93 94 jQuery('.section-contact-hero .slider-div').slick({ 95 arrows:true, 96 dots:true, 97 slidesToShow: 1, 98 slidesToScroll: 1, 99 swipeToSlide: true, 100 infinite: false, 101 autoplay: true, 102 autoplaySpeed: 3000, 103 }); 104 105 jQuery('.section-sustainability-hero .slider-div').slick({ 106 arrows:true, 107 dots:true, 108 slidesToShow: 1, 109 slidesToScroll: 1, 110 swipeToSlide: true, 111 infinite: false, 112 autoplay: true, 113 autoplaySpeed: 3000, 114 }); 115 116 jQuery('.section-corporate-hero .slider-div').slick({ 117 arrows:true, 118 dots:false, 119 slidesToShow: 1, 120 slidesToScroll: 1, 121 swipeToSlide: true, 122 infinite: false, 123 autoplay: true, 124 autoplaySpeed: 3000, 125 }); 126 127 jQuery('.section-corporate-detail-hero .slider-div').slick({ 128 arrows:true, 129 dots:false, 130 slidesToShow: 1, 131 slidesToScroll: 1, 132 swipeToSlide: true, 133 infinite: false, 134 autoplay: true, 135 autoplaySpeed: 3000, 136 }); 137 138 jQuery('.section-home-delivery-hero .slider-div').slick({ 139 arrows:true, 140 dots:true, 141 slidesToShow: 1, 142 slidesToScroll: 1, 143 swipeToSlide: true, 144 infinite: false, 145 autoplay: true, 146 autoplaySpeed: 3000, 147 }); 148 149 jQuery('.customer-reviews .content-div').slick({ 150 arrows:true, 151 dots:false, 152 slidesToShow: 3, 153 slidesToScroll: 1, 154 swipeToSlide: true, 155 infinite: true, 156 /*centerMode: true, 157 variableWidth: true*/ 158 //autoplay: true, 159 //autoplaySpeed: 3000, 160 }); 161 162 jQuery('.testimonials-div .content-div').slick({ 163 arrows:true, 164 dots:false, 165 slidesToShow: 3, 166 slidesToScroll: 1, 167 swipeToSlide: true, 168 infinite: true, 169 /*centerMode: true, 170 variableWidth: true*/ 171 //autoplay: true, 172 //autoplaySpeed: 3000, 173 responsive: [ 174 { 175 breakpoint: 768, 176 settings: { 177 slidesToShow: 1, 178 slidesToScroll: 1 179 } 180 } 181 ] 182 }); 183 184 jQuery('.section-pharmacy-services-hero .slider-div').slick({ 185 arrows:true, 186 dots:true, 187 slidesToShow: 1, 188 slidesToScroll: 1, 189 swipeToSlide: true, 190 infinite: false, 191 autoplay: true, 192 autoplaySpeed: 3000, 193 }); 194 195 jQuery('.section-pharmacy-services-detail-hero .slider-div').slick({ 196 arrows:true, 197 dots:true, 198 slidesToShow: 1, 199 slidesToScroll: 1, 200 swipeToSlide: true, 201 infinite: false, 202 autoplay: true, 203 autoplaySpeed: 3000, 204 }); 205 206 jQuery('.section-specialised-services-hero .slider-div').slick({ 207 arrows:true, 208 dots:true, 209 slidesToShow: 1, 210 slidesToScroll: 1, 211 swipeToSlide: true, 212 infinite: false, 213 autoplay: true, 214 autoplaySpeed: 3000, 215 }); 216 217 jQuery('.section-specialised-services-detail-hero .slider-div').slick({ 218 arrows:true, 219 dots:true, 220 slidesToShow: 1, 221 slidesToScroll: 1, 222 swipeToSlide: true, 223 infinite: false, 224 autoplay: true, 225 autoplaySpeed: 3000, 226 }); 227
228 jQuery('.section-caring-news-hero .slider-div').slick({ 229 arrows:true, 230 dots:true, 231 slidesToShow: 1, 232 slidesToScroll: 1, 233 swipeToSlide: true, 234 infinite: false, 235 autoplay: true, 236 autoplaySpeed: 3000, 237 }); 238 239 jQuery('.section-member-privilege-hero .slider-div').slick({ 240 arrows:true, 241 dots:true, 242 slidesToShow: 1, 243 slidesToScroll: 1, 244 swipeToSlide: true, 245 infinite: false, 246 autoplay: true, 247 autoplaySpeed: 3000, 248 }); 249 250 jQuery('.section-health-talk-hero .slider-div').slick({ 251 arrows:true, 252 dots:true, 253 slidesToShow: 1, 254 slidesToScroll: 1, 255 swipeToSlide: true, 256 infinite: false, 257 autoplay: true, 258 autoplaySpeed: 3000, 259 }); 260 261 jQuery('.section-best-deal-hero .slider-div').slick({ 262 arrows:true, 263 dots:true, 264 slidesToShow: 1, 265 slidesToScroll: 1, 266 swipeToSlide: true, 267 infinite: false, 268 autoplay: true, 269 autoplaySpeed: 3000, 270 }); 271 272 jQuery('.section-coupon-hero .slider-div').slick({ 273 arrows:true, 274 dots:true, 275 slidesToShow: 1, 276 slidesToScroll: 1, 277 swipeToSlide: true, 278 infinite: false, 279 autoplay: true, 280 autoplaySpeed: 3000, 281 }); 282 283 jQuery('.section-media-hero .slider-div').slick({ 284 arrows:true, 285 dots:true, 286 slidesToShow: 1, 287 slidesToScroll: 1, 288 swipeToSlide: true, 289 infinite: false, 290 autoplay: true, 291 autoplaySpeed: 3000, 292 }); 293 294 jQuery('.section-health-campaign-hero .slider-div').slick({ 295 arrows:true, 296 dots:true, 297 slidesToShow: 1, 298 slidesToScroll: 1, 299 swipeToSlide: true, 300 infinite: false, 301 autoplay: true, 302 autoplaySpeed: 3000, 303 }); 304 305 jQuery('.section-career-hero .slider-div').slick({ 306 arrows:true, 307 dots:true, 308 slidesToShow: 1, 309 slidesToScroll: 1, 310 swipeToSlide: true, 311 infinite: false, 312 autoplay: true, 313 autoplaySpeed: 3000, 314 }); 315 316 jQuery('.section-membership-rewards-hero .slider-div').slick({ 317 arrows:true, 318 dots:true, 319 slidesToShow: 1, 320 slidesToScroll: 1, 321 swipeToSlide: true, 322 infinite: false, 323 autoplay: true, 324 autoplaySpeed: 3000, 325 }); 326 327 jQuery('.section-story-team .link-div a').on('click', function(event){ 328 event.preventDefault(); 329 var current_state = jQuery(this).hasClass('shown'); 330 jQuery('.section-story-team .content-div').toggleClass('show-all'); 331 jQuery(this).toggleClass('shown'); 332 if(current_state){ 333 jQuery(this).html('VIEW ALL'); 334 }else{ 335 jQuery(this).html('COLLAPSE'); 336 } 337 }); 338 339 jQuery('.popup-catalogue').on('click', function(event){ 340 event.preventDefault(); 341 triggerPromoPopup(); 342 }); 343 344 jQuery('.section-sustainability-caring .content-div .single-div .link-div a').on('click',function(event){ 345 event.preventDefault(); 346 jQuery(this).parent().parent().parent().addClass('active'); 347 }); 348 349 jQuery('.section-sustainability-caring .content-div .single-div .hover-div .layer-div').on('click',function(event){ 350 event.preventDefault(); 351 jQuery(this).parent().parent().removeClass('active'); 352 }); 353 354 jQuery('.terms-div .filter-div ul li a').on('click', function(){ 355 var this_cat = jQuery(this).data('cat'); 356 jQuery('.terms-div .filter-div ul li a.active').removeClass('active'); 357 jQuery(this).addClass('active'); 358 jQuery('.terms-div .content-div.active').removeClass('active'); 359 jQuery('.terms-div .content-div.'+this_cat).addClass('active'); 360 }); 361 362 jQuery('.location-listing-div .filter-div .top-div .service-category .label').on('click', function(event){ 363 event.preventDefault(); 364 jQuery(this).parent().toggleClass('active'); 365 }); 366 367 jQuery('.location-listing-div .filter-div .top-div .service-category .sub-menu .reset a').on('click', function(event){ 368 event.preventDefault(); 369 jQuery('.location-listing-div .filter-div .top-div .service-category .sub-menu .checkbox-div input[type="checkbox"]').prop( "checked", false ); 370 }); 371 372 jQuery('.location-listing-div').on('click', '.listing-div .single-div .text-div ul.contact-list li.hours .label', function(event){ 373 event.preventDefault(); 374 jQuery(this).parent().toggleClass('active'); 375 jQuery('.location-listing-div .listing-div .single-div .text-div').matchHeight(); 376 }); 377 378 jQuery('footer .bottom-div .row-div .col-div .accordion-div .accordion-title').on('click', function(){ 379 if(jQuery(this).parent().hasClass('non-content')){ 380 381 }else{ 382 jQuery(this).parent('.accordion-div').toggleClass('active'); 383 } 384 }); 385 386 jQuery('a[href*=\\#]').on('click', function(event) { 387 //jQuery('#site-navigation').removeClass('active'); 388 // Make sure this.hash has a value before overriding default behavior 389 if(jQuery(this).parent().hasClass('link-section')){ 390 if(jQuery('body').hasClass('page-id-68')){ 391 if (this.hash !== "") { 392 // Prevent default anchor click behavior 393 event.preventDefault(); 394 395 // Store hash 396 var hash = this.hash; 397 398 var adminBarH = jQuery("#wpadminbar").length ? jQuery("#wpadminbar").outerHeight() : 0; 399 var topBarH = jQuery(window).outerWidth() > 1240 ? jQuery("#masthead").outerHeight() : 0; 400 401 var scrollH = jQuery(hash).offset().top; 402 403 //console.log(adminBarH); 404 //console.log(topBarH); 405 //console.log(scrollH); 406 407 // Using jQuery's animate() method to add smooth page scroll 408 // The optional number (800) specifies the number of milliseconds it takes to
408scroll to the specified area 409 /*jQuery('html, body').animate({ 410 scrollTop: jQuery(hash).offset().top - adminBarH - topBarH 411 }, 800, function(){ 412 413 // Add hash (#) to URL when done scrolling (default click behavior) 414 window.location.hash = hash; 415 });*/ 416 417 jQuery("html, body").animate({ scrollTop: jQuery(hash).offset().top - adminBarH - topBarH }); 418 return false; 419 } // End if 420 }else{ 421 422 } 423 }else if(jQuery(this).parent().hasClass('img-div')){ 424 425 }else{ 426 if (this.hash !== "") { 427 // Prevent default anchor click behavior 428 event.preventDefault(); 429 430 // Store hash 431 var hash = this.hash; 432 433 var adminBarH = jQuery("#wpadminbar").length ? jQuery("#wpadminbar").outerHeight() : 0; 434 var topBarH = jQuery(window).outerWidth() > 1240 ? jQuery("#masthead").outerHeight() : 0; 435 436 var scrollH = jQuery(hash).offset().top; 437 438 //console.log(adminBarH); 439 //console.log(topBarH); 440 //console.log(scrollH); 441 442 // Using jQuery's animate() method to add smooth page scroll 443 // The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area 444 /*jQuery('html, body').animate({ 445 scrollTop: jQuery(hash).offset().top - adminBarH - topBarH 446 }, 800, function(){ 447 448 // Add hash (#) to URL when done scrolling (default click behavior) 449 window.location.hash = hash; 450 });*/ 451 452 jQuery("html, body").animate({ scrollTop: jQuery(hash).offset().top - adminBarH - topBarH }); 453 return false; 454 } // End if 455 } 456 457 }); 458 459 jQuery('header .header-main .col.first .navbar-toggle, .header-menu-sidebar .navbar-toggle-wrapper button.navbar-toggle').on('click',function(){ 460 jQuery('body').toggleClass('open-mobile-menu').removeClass('mobile-menu-active'); 461 }); 462 463 jQuery('button.mobile-menu-toggle').on('click', function(event){ 464 event.preventDefault(); 465 jQuery('body').toggleClass('open-mobile-menu'); 466 }); 467 468 /*jQuery('#header-menu-sidebar .menu-main-menu-container ul.menu li > .sub-menu').on('click', function(event){ 469 event.preventDefault(); 470 jQuery(this).parent().toggleClass('active'); 471 });*/ 472 473 jQuery('#header-menu-sidebar .menu-main-menu-container ul.menu li.menu-item-has-children > button.toggle-btn').on('click', function(event){ 474 event.preventDefault(); 475 jQuery(this).parent().toggleClass('active'); 476 //jQuery(this).toggleClass('active'); 477 }); 478 479 /*jQuery('#header-menu-sidebar-inner ul.main-list li .sub-menu-toggle').on('click', function(event){ 480 event.preventDefault(); 481 jQuery(this).parent().parent().toggleClass('active'); 482 if(jQuery(this).children().hasClass('fa-angle-down')){ 483 jQuery(this).html('<i class="fa-solid fa-angle-up"></i>'); 484 }else{ 485 jQuery(this).html('<i class="fa-solid fa-angle-down"></i>'); 486 } 487 });*/ 488 489 jQuery('#header-menu-sidebar-inner ul.main-list li .sub-menu-toggle').on('click', function(event){ 490 event.preventDefault(); 491 jQuery(this).parent().parent().addClass('clicked'); 492 jQuery(this).children().addClass('active'); 493 jQuery('#header-menu-sidebar-inner ul.main-list li.clicked.active').addClass('currently-active'); 494 jQuery('#header-menu-sidebar-inner ul.main-list li').removeClass('active'); 495 jQuery('#header-menu-sidebar-inner ul.main-list li:not(.clicked) .sub-menu-toggle').html('<i class="fa-solid fa-angle-down"></i>'); 496 jQuery('#header-menu-sidebar-inner ul.main-list li.clicked').addClass('active'); 497 jQuery('#header-menu-sidebar-inner ul.main-list li.currently-active').removeClass('active'); 498 jQuery('#header-menu-sidebar-inner ul.main-list li.currently-active').removeClass('currently-active'); 499 jQuery('#header-menu-sidebar-inner ul.main-list li.clicked').removeClass('clicked'); 500 //$(this).parent().parent().toggleClass('active'); 501 if(jQuery(this).children().hasClass('fa-angle-down')){ 502 jQuery(this).html('<i class="fa-solid fa-angle-up"></i>'); 503 }else{ 504 jQuery(this).html('<i class="fa-solid fa-angle-down"></i>'); 505 } 506 }); 507 508 jQuery('footer .accordion-div h3').on('click', function(event){ 509 if(jQuery(this).parent().parent().hasClass('non-content')){ 510 511 }else{ 512 event.preventDefault(); 513 jQuery(this).parent().toggleClass('active'); 514 if(jQuery(this).children().children().hasClass('fa-chevron-down')){ 515 jQuery(this).children().html('<i class="fa-solid fa-chevron-up"></i>'); 516 }else{ 517 jQuery(this).children().html('<i class="fa-solid fa-chevron-down"></i>'); 518 } 519 } 520 }); 521 522 jQuery('.wpcf7 select[name="preferred-work-location"]').on('change',function(event){ 523 event.preventDefault(); 524 525 var preferred_work_location = jQuery(this).val(), 526 trimmed_preferred_work_location = preferred_work_location.trim(), 527 formatted_preferred_work_location = trimmed_preferred_work_location.toLowerCase().replace(/\s+/g, '-'); 528 529 jQuery('.wpcf7 select[name="store-options"]').prop('disabled', 'disabled'); 530 531 //console.log(formatted_preferred_work_location); 532 533 jQuery.ajax({ 534 type: 'POST', 535 url: 'https://caring2u.com/wp-admin/admin-ajax.php', 536 data: {'action' : 'store_options_ajax_handle_request', 'work_location': formatted_preferred_work_location}, 537 //dataType: 'json', 538 dataType: 'html', 539 success: function(result) { 540 //console.log(result); 541 jQuery('.wpcf7 select[name="store-options"]').html(result); 542 jQuery('.wpcf7 select[name="store-options"]').prop('disabled', false); 543 } 544 }); 545 }); 546 547 var catalogue = getUrlParameter('catalogue'); 548 if(catalogue == 'promotion'){ 549 triggerPromoPopup(); 550 } 551 552 jQuery('.three-columns-slider').slick({ 553 arrows:true, 554 dots:true, 555 slidesToShow: 3, 556 slidesToScroll: 3, 557 swipeToSlide: true, 558 infinite: true, 559 autoplay: true, 560 autoplaySpeed: 3000, 561 responsive: [ 562 { 563 breakpoint: 768, 564 settings: { 565 slidesToShow: 1, 566 slidesToScroll: 1, 567 arrows:false, 568 } 569 } 570 ] 571 }); 572 573 jQuery('.section-bye-articles .three-columns-slider .single-div').matchHeight(); 574 575 jQuery('.video-slider-div').slick({ 576 arrows:true, 577 dots:true, 578 slidesToShow: 4, 579 slidesToScroll: 4, 580 swipeToSlide: true, 581 infinite: true, 582 autoplay: true, 583 autoplaySpeed: 3000, 584 responsive: [ 585 { 586 breakpoint: 768, 587 settings: { 588 slidesToShow: 1, 589 slidesToScroll: 1, 590 arrows:false, 591 } 592 } 593 ] 594 }); 595 596 jQuery('.pharmacist-div').slick({ 597 initialSlide: 2, 598 arrows:false, 599 dots:false, 600 slidesToShow: 1, 601 slidesToScroll: 1, 602 swipeToSlide: true, 603 infinite: true, 604 responsive: [ 605 { 606 breakpoint: 9999, 607 settings: "unslick" 608 }, 609 { 610 breakpoint: 768, 611 settings: { 612 slidesToShow: 1, 613 slidesToScroll: 1, 614 arrows:false, 615 } 616 } 617 ] 618 }); 619 620 jQuery('.button-div .view-all').on('click', function(event){ 621 event.preventDefault(); 622 jQuery('.three-columns-div .single-div.hidden').removeClass('hidden'); 623 }); 624}); 625 626jQuery(window).scroll(function() { 627 var scroll = jQuery(window).scrollTop(); 628 629 if (scroll >= 100) { 630 jQuery("#masthead-sticky-wrapper").addClass("scrolled"); 631 jQuery("#masthead").addClass("scrolled"); 632 } else { 633 jQuery("#masthead-sticky-wrapper").removeClass("scrolled"); 634 jQuery("#masthead").removeClass("scrolled"); 635 } 636}); 637 638jQuery(window).on('scroll', function () { 639 // Auto docking 640 isMobile = jQuery(window).width() < 768 ? true : false;
641 642 if(!isMobile) { 643 jQuery(".auto-dock").each(function () { 644 let elem = jQuery(this); 645 auto_dock_func(elem); 646 }); 647 648 // current_active_tab(".p-tabs-wrapper", p_tabs_wrapper); 649 } else { 650 jQuery(".auto-dock.auto-dock-mobile").each(function () { 651 let elem = jQuery(this); 652 auto_dock_func(elem); 653 }); 654 } 655 656 if(!isMobile) { 657 jQuery(".auto-dock-elem").each(function () { 658 let elem = jQuery(this); 659 auto_dock_elem_func(elem); 660 }); 661 662 if( jQuery(window).scrollTop() > 50 ) { 663 jQuery('header').addClass('scrolled'); 664 } else { 665 jQuery('header').removeClass('scrolled'); 666 } 667 } 668}); 669 670/* Function : Auto-docking all elements with .auto-dock class in relative to its parent container */ 671function auto_dock_func(elem) { 672 let ptop = elem.data('ptop'); 673 let parent = elem.data('parent'); 674 let initt = elem.data('initt'); 675 let offset_h = initt + $(parent).outerHeight() - elem.outerHeight(); 676 let scrollTop = $(window).scrollTop(); 677 678 if (!initt) { 679 let width = elem.outerWidth(); 680 elem.data('initt', $(parent).offset().top - headerH - ptop); 681 elem.css('width', width + 'px'); 682 elem.css('top', (ptop + headerH) + 'px'); 683 } else if(($(parent).height() - 30) <= elem.outerHeight()) { 684 elem.removeClass("docked"); 685 elem.removeClass("docked-bottom"); 686 } else if (scrollTop >= initt && scrollTop < offset_h) { 687 elem.addClass("docked"); 688 elem.removeClass("docked-bottom"); 689 } else if (scrollTop >= offset_h) { 690 elem.removeClass("docked"); 691 elem.addClass("docked-bottom"); 692 } else if (scrollTop < initt) { 693 elem.removeClass("docked"); 694 } 695} 696 697/* Function : Auto-docking all elements with .auto-dock class in relative to its parent container */ 698function auto_dock_elem_func(elem) { 699 let ptop = elem.data('ptop'); 700 let parent = elem.data('parent'); 701 let initt = elem.data('initt'); 702 let offset_h = initt + $(parent).outerHeight() - elem.outerHeight(); 703 let scrollTop = $(window).scrollTop(); 704 705 if (!initt) { 706 let width = elem.outerWidth(); 707 elem.data('initt', $(parent).offset().top - headerH - ptop); 708 elem.css('width', width + 'px'); 709 elem.css('top', (ptop + headerH) + 'px'); 710 } else if(($(parent).height() - 30) <= elem.outerHeight()) { 711 elem.removeClass("docked"); 712 elem.removeClass("docked-bottom"); 713 } else if (scrollTop >= initt && scrollTop < offset_h) { 714 elem.addClass("docked"); 715 elem.removeClass("docked-bottom"); 716 } else if (scrollTop >= offset_h) { 717 elem.removeClass("docked"); 718 elem.addClass("docked-bottom"); 719 } else if (scrollTop < initt) { 720 elem.removeClass("docked"); 721 } 722} 723 724function triggerPromoPopup(){ 725 jQuery('.catalogue-div a').click(); 726} 727 728 var getUrlParameter = function getUrlParameter(sParam) { 729 var sPageURL = window.location.search.substring(1), 730 sURLVariables = sPageURL.split('&'), 731 sParameterName, 732 i; 733 734 for (i = 0; i < sURLVariables.length; i++) { 735 sParameterName = sURLVariables[i].split('='); 736 737 if (sParameterName[0] === sParam) { 738 return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]); 739 } 740 } 741 return false; 742};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.