1(function ($) { 2 "use strict"; 3 4 5// jQuery(window).scroll(function () { 6 // var scrollPos = jQuery(document).scrollTop() + 100; 7 // jQuery("#tocc .nav.navbar-nav > li > a.nav-link").each( 8 // function () { 9 // var currLink = jQuery(this); 10 // var refElement = jQuery(currLink.attr("href")); 11 // if (refElement.length > 0) { 12 // if ( 13 // refElement.position().top <= scrollPos && 14 // refElement.position().top + refElement.height() > 15 // scrollPos && 16 // refElement.length > 0 17 // ) { 18 // jQuery("#tocc .nav.navbar-nav > li").removeClass("active"); 19 // currLink.closest("li").prevAll().removeClass("active"); 20 // currLink.closest(".nav.navbar-nav").prevAll().removeClass("active"); 21 // currLink.closest(".nav.navbar-nav").nextAll().removeClass("active"); 22 // currLink.closest("li").nextAll().removeClass("active"); 23 // currLink.removeClass("active"); 24 // currLink.addClass("active"); 25 // if (jQuery(this).hasClass("active")) { 26 // jQuery(this).parent().addClass("active"); 27 // } 28 // } 29 // } 30 // } 31 // ); 32// }); 33 34jQuery(window).load(function () { 35 36 37 38 var ll = jQuery("#tocc .nav.navbar-nav > li:first-child > a.nav-link").attr( 39 "href" 40 ); 41 if (jQuery(ll).length > 0) { 42 var hll = jQuery(ll).offset().top; 43 jQuery("#tocc .nav.navbar-nav > li a.nav-link").removeClass("active"); 44 45 var navSelector = "#tocc"; 46 // if(jQuery(document).scrollTop()+200 > hll){ 47 // jQuery('#tocc .nav.navbar-nav > li:first-child > a.nav-link').addClass('active'); 48 // } 49 // jQuery("body").scrollspy({ 50 // target: navSelector, 51 // offset: 80, 52 // }); 53 } 54 55 56 if (jQuery(".video-popup").length) { 57 jQuery(".video-popup").magnificPopup({ 58 disableOn: 700, 59 type: "iframe", 60 mainClass: "mfp-fade", 61 removalDelay: 160, 62 preloader: true, 63 fixedContentPos: false, 64 }); 65 } 66 67 68 69 // post feed 70 jQuery(document).on("click", '#tocc a[href^="#"]', function (e) { 71 // target element id 72 var id = jQuery(this).attr("href"); 73 var hh = jQuery(this).parent(); 74 // target element 75 var $id = $(id); 76 if ($id.length === 0) { 77 return; 78 } 79 80 e.preventDefault(); 81 82 // top position relative to the document 83 var pos = $id.offset().top - 120; 84 85 // animated top scrolling 86 jQuery("body, html").animate({ scrollTop: pos },function(){ 87 $('#tocc li').removeClass("active"); 88 hh.addClass("active"); 89 }); 90 }); 91 92}); 93 94 95 jQuery(function () { 96 var navSelector = "#tocc"; 97 // var $myNav = jQuery(navSelector); 98 // Toc.init({ 99 // $nav: jQuery("#tocc"), 100 // $scope: jQuery( 101 // ".single-cover section:not(.two_column_text_with_cta) h2,.single-cover h1" 102 // ), 103 // }); 104 105 }); 106 107 var Tocc = { 108 init: function() { 109 this.generateTOC(); 110 this.highlightActive(); 111 $(window).on('scroll', this.highlightActive); 112 // Remove the child and its parent from the #toc list 113 }, 114 generateUniqueID: function(text) { 115 116 var baseId = text.replace(/[^a-zA-Z0-9\s]/g, '').replace(/\s+/g, '-').toLowerCase(); 117 var uniqueId = baseId; 118 var counter = 1; 119 120 // Check if the ID already exists, if yes, add a counter to make it unique 121 while ($("#" + uniqueId).length) { 122 uniqueId = baseId + '_' + counter++; 123 } 124 125 return uniqueId; 126 }, 127 generateTOC: function() { 128 // Find all content sections and generate TOC items 129 $(".single-cover h2,.single-cover h1:not(.maintitle)").each(function(index) { 130 var headingLevel = $(this).text().toLowerCase(); 131 var sectionId = Tocc.generateUniqueID($(this).text()); 132 var sectionTitle = $(this).text(); 133 $(this).attr("id",sectionId); 134 // Append TOC item to the #toc list 135 $(document).find("#tocc .navbar-nav").append('<li><a href="#' + sectionId + '" class="nav-link">' + sectionTitle + '</a></li>'); 136 }); 137 }, 138 highlightActive: function() { 139 // Get the current scroll position 140 var scrollPosition = $(window).scrollTop() + 100; 141 142 // Loop through each section and highlight the active TOC item 143 $(document).find("#tocc .nav.navbar-nav > li > a.nav-link").each(function() { 144 var sectionId = $(this).attr("href"); 145 console.log(sectionId); 146 if($(sectionId).length > 0){ 147 var sectionOffset = $(sectionId).offset().top - 200; // Adjust for navbar height 148 149 if (scrollPosition >= sectionOffset) { 150 // Remove 'active' class from all TOC items 151 $("#tocc li").removeClass("active"); 152 153 // Add 'active' class to the corresponding TOC item 154 $("#tocc li:has(a[href='" + sectionId + "'])").addClass("active"); 155 } 156 } 157 }); 158 } 159 160 }; 161 $("#tocc").append('<ul class="nav navbar-nav">'); 162 Tocc.init(); 163 164 165 166//menu hover 167if($( window ).width() > 990){ 168$(".main-navigation > ul > li.megamenu").mouseover(function(){ 169 $('.main-navigation > ul > li').removeClass("before after"); 170 $('.main-navigation > ul > li').removeClass("active"); 171 $(this).addClass("active"); 172 $(this).prev( "li" ).addClass('before'); 173 $(this).next( "li" ).addClass('after'); 174 $('.main-navigation > ul').addClass('megamenu-open'); 175}); 176$(".main-navigation > ul > li.megamenu").mouseout(function(){ 177 $('.main-navigation > ul > li').removeClass("before after"); 178 $('.main-navigation > ul > li').removeClass("active"); 179 $('.main-navigation > ul').removeClass('megamenu-open'); 180}); 181} 182if($( window ).width() < 990){ 183$('#site-navigation ul > li:first-child').find('.row').addClass('align-items-center'); 184 185$(".main-navigation > ul > li.megamenu > a").on('click',function(e){
186 e.preventDefault(); 187 if( $(this).parent().hasClass("active")){ 188 $('.main-navigation > ul').removeClass('megamenu-open'); 189 $(this).parent().removeClass("active"); 190 }else{ 191 $(this).parent().addClass("active"); 192 $(this).prev( "li" ).addClass('before'); 193 $(this).next( "li" ).addClass('after'); 194 $('.main-navigation > ul').addClass('megamenu-open'); 195 } 196}); 197} 198$(".main-navigation > ul > li.megamenu:nth-child(1)").mouseover(function(){ 199 $('.main-navigation > ul').addClass('megamenu-1'); 200}); 201$(".main-navigation > ul > li.megamenu").mouseout(function(){ 202 $('.main-navigation > ul').removeClass('megamenu-1'); 203}); 204$(".main-navigation > ul > li.megamenu:nth-child(2)").mouseover(function(){ 205 $('.main-navigation > ul').addClass('megamenu-2'); 206}); 207$(".main-navigation > ul > li.megamenu").mouseout(function(){ 208 $('.main-navigation > ul').removeClass('megamenu-2'); 209}); 210$(".main-navigation > ul > li.megamenu:nth-child(4)").mouseover(function(){ 211 $('.main-navigation > ul').addClass('megamenu-4'); 212}); 213$(".main-navigation > ul > li.megamenu").mouseout(function(){ 214 $('.main-navigation > ul').removeClass('megamenu-4'); 215}); 216$(".main-navigation > ul > li.megamenu:nth-child(5)").mouseover(function(){ 217 $('.main-navigation > ul').addClass('megamenu-5'); 218}); 219$(".main-navigation > ul > li.megamenu").mouseout(function(){ 220 $('.main-navigation > ul').removeClass('megamenu-5'); 221}); 222$(".main-navigation > ul > li.megamenu:nth-child(6)").mouseover(function(){ 223 $('.main-navigation > ul').addClass('megamenu-6'); 224}); 225$(".main-navigation > ul > li.megamenu").mouseout(function(){ 226 $('.main-navigation > ul').removeClass('megamenu-6'); 227}); 228 229 230 231if (jQuery(window).width() >= 1024){ 232 $('.default-menu-with-megamenu > nav > ul > .dropdown').mouseover(function(){ 233 if($(document).find('#nextractor').length < 1){ 234 $(this).closest('ul').append('<div id="nextractor"> </div>'); 235 } 236 }); 237 238} 239$(".default-menu-with-megamenu ul li.megamenu").mouseout(function(){ 240 241 $("#nextractor").remove(); 242 243}); 244//$('.main-navigation > ul').append('<div id="nextractor"> </div>'); 245$('.default-menu-with-megamenu > nav > ul > .dropdown').mouseover(function(){ 246 var height = $(this).find('.dropdown-menu-inr').outerHeight(); 247 $('#nextractor').css("height", height); 248}); 249 250 251 252 253 254 255 256//// event dropdown 257 258$(document).on('change','.eventviews', function(){ 259 if($(this).val() == 'month'){ 260 $('.tribe-events-c-view-selector__list-item--month a').trigger('click'); 261 } 262 if($(this).val() == 'list'){ 263 $('.tribe-events-c-view-selector__list-item--list a').trigger('click'); 264 } 265}); 266 267if($('.tribe-events-c-view-selector__list-item--list').hasClass('tribe-events-c-view-selector__list-item--active')){ 268 $('.eventviews').val('list') ; 269} 270 271if($('.tribe-events-c-view-selector__list-item--month').hasClass('tribe-events-c-view-selector__list-item--active')){ 272 $('.eventviews').val('month') ; 273} 274 275 276 277 278$(".pre-header-menu .menu li.menu-item-has-children > a").on('click',function(e){ 279 e.preventDefault(); 280 if(!$(this).parent().hasClass("active")) { 281 $(".pre-header-menu .menu li.menu-item-has-children").removeClass("active"); 282 $(this).parent().addClass("active"); 283 } else { 284 $(".pre-header-menu .menu li.menu-item-has-children").removeClass("active"); 285 } 286}); 287 288 289 290 291 292AOS.init({ 293 duration: 1200, 294 once: true, 295}); 296 297$(".selected-page").click(function () { 298 $(".dropdown-block ul").toggle(); 299}); 300$(".dropdown-block ul").click(function () { 301 $(this).hide(); 302}); 303 304$( "#hamburger-icon" ).on('click touchstart', function(e) { 305 e.preventDefault(); 306 $(".header-main").toggleClass("menu-open"); 307 $("#hamburger-icon").toggleClass("hamburger-open"); 308 $("body").toggleClass("overflow-hidden"); 309}); 310 311$(".find_trainer_map_data_table ").hide(); 312 $('.ripple-dots').on('click',function() { 313 var sid = $(this).data('sid'); 314 315 if(!$(this).hasClass('active') ){ 316 $(".find_trainer_map_data_table ").hide(); 317 $(".find_trainer_map_data").addClass("active"); 318 $('.ripple-dots').removeClass('active'); 319 $(this).addClass('active'); 320 $(".find_trainer_map_data_table."+sid).show(); 321 322 } else { 323 $(this).removeClass('active'); 324 $(".find_trainer_map_data_table ").hide(); 325 $(".find_trainer_map_data").removeClass("active"); 326 327 } 328 329 330 331 });
332 $('.close-map-box').click(function() { 333 $('.ripple-dots').removeClass('active'); 334 $(".find_trainer_map_data").removeClass("active"); 335 }); 336 337 338 $(window).bind("resize", function () { 339 console.log($(this).width()) 340 if ($(this).width() < 767) { 341 $(".third-navigation > ul").mCustomScrollbar({ 342 axis:"x", 343 theme:"dark", 344 advanced:{autoExpandHorizontalScroll:true} 345 }); 346 } else { 347 $(".third-navigation > ul").mCustomScrollbar('destroy'); 348 } 349 }).trigger('resize'); 350 351 $(window).bind("resize", function () { 352 console.log($(this).width()) 353 if ($(this).width() < 991) { 354 $(".tabs-main").mCustomScrollbar({ 355 axis:"x", 356 theme:"dark", 357 advanced:{autoExpandHorizontalScroll:true} 358 }); 359 } else { 360 $(".tabs-main").mCustomScrollbar('destroy'); 361 } 362 }).trigger('resize'); 363 364 $(window).bind("resize", function () { 365 console.log($(this).width()) 366 if ($(this).width() < 767) { 367 $(".full-width-image").mCustomScrollbar({ 368 axis:"x", 369 theme:"dark", 370 advanced:{autoExpandHorizontalScroll:true} 371 }); 372 } else { 373 $(".full-width-image").mCustomScrollbar('destroy'); 374 } 375 }).trigger('resize'); 376 377 378 379 380 381 382 383 $(window).scroll(function(){ 384 if ($(window).scrollTop() >= 200) { 385 $('.header-primary').addClass('fixed-header'); 386 $('body').addClass('sticky-header-active'); 387 $('.page-id-401 .breadcrumbs-section, .page-id-799 .breadcrumbs-section, .page-id-811 .breadcrumbs-section, .page-id-812 .breadcrumbs-section').addClass('fixed-breadcrumbs'); 388 } 389 else { 390 $('.header-primary').removeClass('fixed-header'); 391 $('body').removeClass('sticky-header-active'); 392 $('.page-id-401 .breadcrumbs-section, .page-id-799 .breadcrumbs-section, .page-id-811 .breadcrumbs-section, .page-id-812 .breadcrumbs-section').removeClass('fixed-breadcrumbs'); 393 } 394 }); 395 396 397 398 399 400 //Tabbing 401 jQuery('.tab-btns li a').on('click', function(){ 402 var target = jQuery(this).attr('data-rel'); 403 jQuery('.tab-btns li a').removeClass('active'); 404 jQuery(this).addClass('active'); 405 jQuery("#"+target).fadeIn('slow').siblings(".tab").hide(); 406 return false; 407 }); 408 409 /* Accrodion Toggle JS */ 410 setTimeout(function () { 411 jQuery(document).on('click','.accrodion-title',function(){ 412 var $this = $(this).siblings('.accrodion-content').find('.fade-up-accrodion'); 413 $this.removeClass('active-up'); 414 jQuery('.accrodion-item').removeClass('active'); 415 jQuery('.accrodion-content').slideUp(); 416 if(jQuery(this).next().is(":visible")){ 417 jQuery(this).removeClass('active'); 418 jQuery(this).next().slideUp(); 419 } 420 else { 421 jQuery(this).parent().addClass('active'); 422 jQuery(this).next().slideDown(); 423 window.setTimeout(function(){ 424 $this.addClass('active-up'); 425 }, 300); 426 } 427 }); 428 }, 1200); 429 430 /* Accrodion Toggle JS */ 431 setTimeout(function () { 432 jQuery(document).on('click','.course_title',function(){ 433 var $this = $(this).siblings('.course_content').find('.fade-in-accrodion'); 434 $this.removeClass('active-in'); 435 jQuery('.course_itms').removeClass('active'); 436 jQuery('.course_content').slideUp(); 437 if(jQuery(this).next().is(":visible")){ 438 jQuery(this).removeClass('active'); 439 jQuery(this).next().slideUp(); 440 } 441 else { 442 jQuery(this).parent().addClass('active'); 443 jQuery(this).next().slideDown(); 444 window.setTimeout(function(){ 445 $this.addClass('active-in'); 446 }, 300); 447 } 448 }); 449 }, 1200); 450 451 452 453 454 var $slider = $('.header-content-slider'); 455 456 if ($slider.length) { 457 var currentSlide; 458 var slidesCount; 459 var sliderCounter = document.createElement('div'); 460 sliderCounter.classList.add('slider__counter'); 461 462 var updateSliderCounter = function(slick, currentIndex) { 463 currentSlide = slick.slickCurrentSlide() + 1; 464 slidesCount = slick.slideCount; 465 $(sliderCounter).text(data.next+' ' +currentSlide + ' / ' +slidesCount), 466 $(".slider__counter").wrapInner('<div class="slider__counter-inr"></div>'); 467 468 }; 469 470 $slider.on('init', function(event, slick) { 471 $slider.append(sliderCounter); 472 updateSliderCounter(slick); 473 });
474 475 $slider.on('afterChange', function(event, slick, currentSlide) { 476 updateSliderCounter(slick, currentSlide); 477 478 479 }); 480 481 $('.header-content-slider').on('beforeChange', function (event, slick, currentSlide, nextSlide) { 482 483 484 //alert(nextSlide); 485 if( $('#video' + currentSlide).length > 0){ 486 console.log(currentSlide); 487 $('#video' + currentSlide).get(0).pause(); 488 } 489 if( $('#video' + nextSlide).length > 0){ 490 //pause current 491 $('#video' + nextSlide).get(0).play(); 492 console.log(nextSlide); 493 } 494 //pause current 495}); 496 497 $slider.slick({ 498 arrows: true, 499 // prevArrow: $('.banner-prev-arrow'), 500 nextArrow: $('.banner-next-arrow'), 501 }); 502 } 503 504 505 506 507 // jQuery(document).ready(function(){ 508 // jQuery(".dropdown").click(function(){ 509 // jQuery(this).find(".dropdown-menu").slideToggle("fast"); 510 // jQuery(this).toggleClass("open"); 511 // }); 512 // }); 513 // jQuery(document).on("click", function(event){ 514 // var $trigger = jQuery(".dropdown"); 515 // if($trigger !== event.target && !$trigger.has(event.target).length){ 516 // jQuery(".dropdown-menu").slideUp("fast"); 517 // jQuery(".dropdown").removeClass("open"); 518 // } 519 // }); 520 521 522$('.quotes-slider').slick({ 523 infinite: true, 524 slidesToShow: 1, 525 slidesToScroll: 1, 526 arrows: true, 527 dots: true, 528 fade: true, 529}); 530 531 532// $('.img-vid-slider').slick({ 533// infinite: true, 534// slidesToShow: 1, 535// slidesToScroll: 1, 536// arrows: true, 537// dots: true, 538// }); 539$(".img-vid-slider").each(function() { 540 var $slider = $(this); 541 542 543 // Slider counter functionality 544 var currentSlide; 545 var slidesCount; 546 var sliderCounter = document.createElement('div'); 547 sliderCounter.classList.add('slider__counter'); 548 549 var updateSliderCounter = function(slick, currentIndex) { 550 currentSlide = slick.slickCurrentSlide() + 1; 551 slidesCount = slick.slideCount; 552 $(sliderCounter).text(currentSlide + ' - ' + slidesCount); 553 $(sliderCounter).wrapInner('<div class="slider__counter-inr"></div>'); 554 }; 555 556 // Initialize slider and counter 557 $slider.on('init', function(event, slick) { 558 $slider.closest(".img_vid_gal").find(".slider-nav").append(sliderCounter); 559 updateSliderCounter(slick); 560 }); 561 562 // Update counter after each slide change 563 $slider.on('afterChange', function(event, slick, currentSlide) { 564 updateSliderCounter(slick, currentSlide); 565 }); 566 567 // Initialize slick slider 568 $slider.slick({ 569 infinite: true, 570 slidesToShow: 1, 571 slidesToScroll: 1, 572 arrows: true, 573 dots: false, 574 }); 575 576 // Progress bar functionality 577 var $progressBar =$slider.closest(".img_vid_gal").find(".progress"); 578 var $progressBarLabel = $slider.closest(".img_vid_gal").find(".slider__label"); 579 580 if ($progressBar.length && $progressBarLabel.length) { 581 // Update progress bar on slide change 582 $slider.on("beforeChange", function(event, slick, currentSlide, nextSlide) { 583 var calc = (nextSlide / (slick.slideCount - 1)) * 100; 584 $progressBar 585 .css("background-size", calc + "% 100%") 586 .attr("aria-valuenow", calc); 587 588 $progressBarLabel.text(calc + "% completed"); 589 }); 590 } 591 592}); 593 594//Video Play Pause 595 596// const video = document.getElementById("video"); 597// const circlePlayButton = document.getElementById("circle-play-b"); 598 599// function togglePlay() { 600// if (video.paused || video.ended) { 601// video.play(); 602// } else { 603// video.pause(); 604// } 605// } 606 607// circlePlayButton.addEventListener("click", togglePlay); 608// video.addEventListener("playing", function () { 609// circlePlayButton.style.opacity = 0; 610// }); 611// video.addEventListener("pause", function () { 612// circlePlayButton.style.opacity = 1; 613// }); 614 615 616 617 618 619 620$('.side-blog-list ul li a[href*="#"]').not('.side-blog-list ul li a[href="#"]').not('.side-blog-list ul li a[href="#0"]').click(function(event) { 621 if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { 622 var target = $(this.hash); 623 target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); 624 if (target.length) { 625 event.preventDefault(); 626 $('html, body').animate({ 627 scrollTop: target.offset().top - 50 628 }, 1000, function() { 629 var $target = $(target);
630 $target.focus(); 631 if ($target.is(":focus")) { 632 return false; 633 } else { 634 $target.attr('tabindex','-1'); 635 $target.focus(); 636 }; 637 }); 638 } 639 $('.side-blog-list ul li').each(function () { 640 $(this).removeClass('active'); 641 }) 642 $(this).parent().addClass('active'); 643 } 644}); 645 646//post category newsletter 647 648 $(document).ready(function(){ 649 650 $(document).on('click', '.js_filter_item > a', function(e){ 651 652 e.preventDefault(); 653 654 if($(this).hasClass('mactive')){ 655 $(this).removeClass('mactive'); 656 }else{ 657 $(this).addClass('mactive'); 658 } 659 var arr = [] //create arry 660 $(".js_filter_item a.mactive").each(function() { 661 arr.push($(this).attr('data-category')) //push value in array 662 }); 663 // console.log(arr); 664 665 var category_var = arr.join(","); 666 // console.log(category_var); 667 668 var action = window.location.href.split('?')[0]; 669 var actions = action; 670 $.ajax({
671 url: actions, 672 data: { action: 'filter', category: category_var }, 673 type: 'GET', 674 success: function(result) { 675 console.log(result); 676 $('.latest_news_top').html($(result).find('.latest_news_top').html()); 677 $('.latest_news_bottom').html($(result).find('.latest_news_bottom').html()); 678 679 AOS.init({ 680 duration: 1200, 681 once: true, 682 }); 683 }, 684 error: function(result) { 685 console.warn(result); 686 } 687 }); 688 }); 689 690 691 //post category energized magazine 692 693 $(document).on('click', '.energized_mag > a', function(e){ 694 e.preventDefault(); 695 696 if($(this).hasClass('mactive')){ 697 $(this).removeClass('mactive'); 698 }else{ 699 $(this).addClass('mactive'); 700 } 701 var arr = [] //create arry 702 $(".energized_mag a.mactive").each(function() { 703 arr.push($(this).attr('data-category')) //push value in array 704 }); 705 console.log(arr); 706 var category_var = arr.join(","); 707 console.log(category_var); 708 709 710 //var category_var = $(this).data('category'); 711 var action = window.location.href.split('?')[0]; 712 var actions = action; 713 $.ajax({
714 url: actions, 715 data: { action: 'filter', category: category_var }, 716 type: 'GET', 717 success: function(result) { 718 console.log(result); 719 $('.latest_news_top').html($(result).find('.latest_news_top').html()); 720 $('.latest_news_bottom').html($(result).find('.latest_news_bottom').html()); 721 AOS.init({ 722 duration: 1200, 723 once: true, 724 }); 725 }, 726 error: function(result) { 727 console.warn(result); 728 } 729 }); 730 }); 731 732 733 734 // var json_array = []; 735 736 // $("dropdown-menu ul li a.active").each(function() { 737 // item = {}; //object create 738 // item[$(this).attr('data-name')] = $(this).attr('data-category') 739 // json_array.push(item) //push value in array 740 // }); 741 // console.log(json_array); 742 743 744 745 746 747 748 749 750 //post category newsrooms 751 752 $(document).on('click', '.newsroom > a', function(e){ 753 754 755 e.preventDefault(); 756 757 758 if($(this).hasClass('mactive')){ 759 $(this).removeClass('mactive'); 760 }else{ 761 $(this).addClass('mactive'); 762 } 763 764 var arr = [] //create arry 765 $(".newsroom a.mactive").each(function() { 766 arr.push($(this).attr('data-category')) //push value in array 767 }); 768 769 var category_var = arr.join(","); 770 771 // var category_var = $(this).data('category'); 772 var action = window.location.href.split('?')[0]; 773 var actions = action; 774 $.ajax({
775 url: actions, 776 data: { action: 'filter', category: category_var }, 777 type: 'GET', 778 success: function(result) { 779 console.log(result); 780 $('.latest_news_top').html($(result).find('.latest_news_top').html()); 781 $('.latest_news_bottom').html($(result).find('.latest_news_bottom').html()); 782 AOS.init({ 783 duration: 1200, 784 once: true, 785 }); 786 }, 787 error: function(result) { 788 console.warn(result); 789 } 790 }); 791 }); 792 793 $(document).on('click', '.fectsheets > a', function(e){ 794 795 796 e.preventDefault(); 797 798 if($(this).hasClass('mactive')){ 799 $(this).removeClass('mactive'); 800 }else{ 801 $(this).addClass('mactive'); 802 } 803 804 var arr = [] //create arry 805 $(".fectsheets a.mactive").each(function() { 806 arr.push($(this).attr('data-category')) //push value in array 807 }); 808 809 var category_var = arr.join(","); 810 811 var action = window.location.href.split('?')[0]; 812 var actions = action; 813 $.ajax({
814 url: actions, 815 data: { action: 'filter', category: category_var }, 816 type: 'GET', 817 success: function(result) { 818 console.log(result); 819 $('.latest_news_top').html($(result).find('.latest_news_top').html()); 820 $('.latest_news_bottom').html($(result).find('.latest_news_bottom').html()); 821 AOS.init({ 822 duration: 1200, 823 once: true, 824 }); 825 }, 826 error: function(result) { 827 console.warn(result); 828 } 829 }); 830 }); 831 832 833 $(".navigation-filter-reset").on("click", function (event) { 834 jQuery('.navigation-filter-reset').hide(); 835 event.preventDefault(); 836 var category_var = $(this).data('category'); 837 var action = window.location.href.split('?')[0]; 838 var actions = action; 839 840 window.history.pushState({ href: actions }, "", actions); 841 jQuery.ajax({ 842 url: actions, 843 type: "GET", 844 beforeSend: function () {}, 845 success: function (result) { 846 // console.log(result); 847 $('.latest_news_top').html($(result).find('.latest_news_top').html()); 848 var data = $(result).find(".latest_news_bottom"); 849 console.log(data); 850 $("body .latest_news_bottom").replaceWith(data); 851 AOS.init(); 852 }, 853 error: function (err) { 854 console.log(err); 855 }, 856 }); 857 }); 858 jQuery('.navigation-filter-reset').hide(); 859 860 }); 861 862 863 864 $(function() { 865 $('#input_1_1,#input_1_7').on('keypress', function(e) { 866 $(this).val($(this).val().replace(/[^a-z0-9]/gi, '')); 867 if (e.which == 32){ 868 // console.log('Space Detected'); 869 return false; 870 } 871 }); 872 }); 873 874 $('#input_1_1,#input_1_7').bind('input', function() { 875 var c = this.selectionStart, 876 r = /[^a-z .]/gi, 877 v = $(this).val(); 878 if(r.test(v)) { 879 $(this).val(v.replace(r, '')); 880 c--; 881 } 882 this.setSelectionRange(c, c); 883 }); 884 885 886 jQuery(document).bind("gform_post_render", function () { 887 function checkForInput(element) { 888 // element is passed to the function ^ 889 890 const $gfield = jQuery(element).parents(".gfield"); 891 892 if (jQuery(element).val().length > 0) { 893 $gfield.addClass("isvalue"); 894 } else { 895 $gfield.removeClass("isvalue"); 896 } 897 } 898 899 // The lines below are executed on page load 900 jQuery("input").each(function () { 901 checkForInput(this); 902 }); 903 904 // The lines below (inside) are executed on change & keyup 905 jQuery("input").on("change keyup", function () { 906 checkForInput(this); 907 }); 908 }); //Document 909 910 911 912var cc = window.location.href; 913//console.log(cc); 914 var url = window.location.pathname, 915 urlRegExp = new RegExp(url.replace(/\/$/,'') + "$"); // create regexp to match current url pathname and remove trailing slash if present as it could collide with the link in navigation in case trailing slash wasn't present there 916 // now grab every link from the navigation 917 $('.default-menu-with-megamenu a').each(function(){ 918 // and test its normalized href against the url pathname regexp 919 //console.log($(this).attr('href')); 920 if(cc == $(this).attr('href')){ 921 console.log('hi'); 922 $(this).closest('.dropdown').addClass('currentpage'); 923 } 924 }); 925 926jQuery('.navigation-filter-reset').hide(); 927jQuery('.dropdown-menu ul li a').click( function(){ 928 jQuery('.navigation-filter-reset').show(); 929 930}); 931 932$('.dropdown-menu ul li a').click(function(){ 933 $('li a').removeClass("active"); 934 $(this).addClass("active"); 935}); 936 937 // function setEqualHeight(columns) { 938 // var tallestColumn = 0; 939 940 // columns.each(function () { 941 // var currentHeight = jQuery(this).height(); 942 943 // if (currentHeight > tallestColumn) { 944 // tallestColumn = currentHeight; 945 // } 946 // }); 947 948 // columns.height(tallestColumn); 949 // } 950 // jQuery(window).resize(function () { 951 // setEqualHeight(jQuery('.tabs-content .tab-box')); 952 // }); 953 // setEqualHeight(jQuery('.tabs-content .tab-box')); 954 955})(jQuery); 956 957 958 959jQuery(document).ready(function($) { 960 jQuery(document).on('gform_confirmation_loaded', function(event, formId){ 961 if(formId == 5 || formId == 6) { 962 // run code specific to form ID 1 963 $(".form-section h2").addClass("text-center"); 964 } 965 }); 966});
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.