var $j = jQuery.noConflict(); var vpHeight = $j( window ).height(); var headerHeight = 0; var headerEl; $j( document ).ready( function() { var nav = $j( '.header-middle' ); var headerWrapper = $j( '.header-wrapper' ); // Burger bar on click $j( '.nav-toggler' ).click( function() { nav.slideToggle( 200 ); headerWrapper.toggleClass( 'open' ); }); // Hide Annoumcement $j( 'body' ).on( 'click', '.hide-announcement', function(e) { console.log( 'hide' ); e.preventDefault(); $j( this ).parents( '.wp-block-columns' ).slideUp( 400 ); $j.ajax({ type : "POST", dataType : "json", url : "/wp-admin/admin-ajax.php", data : {action: "closeAnnouncement", announcementid: announcementID}, success: function(response) { } }); }); // Make title height the same equalizeAllBoxes(); $j(window).on("resize", function(event) { equalizeAllBoxes(); }); function equalizeAllBoxes() { $j('.thinkific-courses-wrapper').each(function(){ // Full var tallestBox = 0; $j('.full .class-wrapper .class-title',this).height("auto"); // Select and loop the elements you want to equalise $j('.full .class-wrapper .class-title', this).each(function(){ // If this box is higher than the cached highest then store it if($j(this).height() > tallestBox) { tallestBox = $j(this).height(); } }); // Set the height of all those children to whichever was highest let width = $j(window).width(); if((width >= 576)) { $j('.full .class-wrapper .class-title',this).height(tallestBox); } else { $j('.full .class-wrapper .class-title',this).height("auto"); } // Compact tallestBox = 0; $j('.compact .class-wrapper .class-title',this).height("auto"); // Select and loop the elements you want to equalise $j('.compact .class-wrapper .class-title', this).each(function(){ // If this box is higher than the cached highest then store it if($j(this).height() > tallestBox) { tallestBox = $j(this).height(); } }); // Set the height of all those children to whichever was highest width = $j(window).width(); if((width >= 576)) { $j('.compact .class-wrapper .class-title',this).height(tallestBox); } else { $j('.compact .class-wrapper .class-title',this).height("auto"); } }); }; // See More Courses $j( '.courses-more-action .std-button-alt' ).click( function(e) { var buttonEl = $j( this ); buttonEl.addClass( 'loading' ); if ( buttonEl.hasClass( 'open' ) ) { buttonEl.removeClass( 'open' ); $j( '.courses-more-wrapper' ).slideUp( 400, function() { buttonEl.html( 'See all classes' ); buttonEl.removeClass( 'loading' ); }); } else { buttonEl.addClass( 'open' ); $j( '.courses-more-wrapper' ).slideDown( 800, function() { buttonEl.html( 'See less' ); buttonEl.removeClass( 'loading' ); }); } equalizeAllBoxes(); }); /* Hide promo */ var searchStrings = ["Founding Member Premium PLUS Masterclasses", "Insider Legacy Founding Member Rate"]; // Check if .mepr-account-product a contains any of the search strings var hasSearchString = searchStrings.some(function(str) { return $j(".mepr-account-product a").text().includes(str); }); if (!hasSearchString) { // Hide the