PageSourceSearch

https://marthabeck.com/wp-content/themes/martha-beck-2024/_static/js/main.js?ver=1790271760

js marthabeck.com collected 2026-09-24 17:44:45 UTC 28,914 bytes, 898 lines download raw bytes

1/*  -------------------------------------------------------
2	Javascript helper document insert any simple JS functions here.
3------------------------------------------------------- */
4
5jQuery(document).ready(function ($) {
6    if ($(".lct-instructors").length > 0) {
7        let bioPopup = `<div id="bio-pop" class="bio-pop">
8                        <div class="close-bar"><a href="#" class="bio-close"></a></div>
9                        <div class="bio-cols">
10                            <div class="col-1">
11                                <div class="img">
12                                    <img src=""/>
13                                </div>
14                                <div class="name"></div>
15                                <div class="title"></div>
16                                <div class="subtext"></div>
17                                <div class="states"></div>
18                                <div class="specialties"></div>
19                                <div class="role">
20                                    <div class="role-title">Program Role:</div>
21                                    <div class="role-content"></div>
22                                </div>
23                            </div>
24                            <div class="col-2">
25                                <div class="popup-bio"></div>
26                                   <div class="badges">
27
28                                   </div>
29                            </div>
30                        </div>
31                    </div>`;
32        $(".lct-instructors").append(bioPopup);
33
34        $(".bio-close,.popup-trigger,.popup-trigger-img").on('click', function (e) {
35            e.preventDefault();
36            $('body').css('overflow', 'hidden');
37            $('header.site-header.header-sticky').css('z-index', '1');
38
39            var $bioPopup = $(".bio-pop");
40
41            if ($bioPopup.hasClass("open")) {
42                $bioPopup.removeClass("open");
43                document.getElementById('fade').style.display = 'none';
44                $('body').css('overflow', 'auto');
45                $('header.site-header.header-sticky').css('z-index', '3');
46            } else {
47                document.getElementById('fade').style.display = 'block';
48
49                let $instructor = $(this).closest('.instructor');
50                let badges = $instructor.attr('data-badges').split(',');
51
52
53                $bioPopup.find('.img img').attr('src', $instructor.attr('data-img'));
54                $bioPopup.find('.name').html($instructor.attr('data-name'));
55                $bioPopup.find('.title').html($instructor.attr('data-title'));
56                $bioPopup.find('.subtext').html($instructor.attr('data-subtext'));
57                $bioPopup.find('.states').html($instructor.attr('data-states'));
58                $bioPopup.find('.specialties').html($instructor.attr('data-specialties'));
59                $bioPopup.find('.role .role-content').html($instructor.attr('data-role'));
60                $bioPopup.find('.popup-bio').html($instructor.attr('data-bio'));
61                $bioPopup.find('.badges').html('');
62
63                $bioPopup.addClass("open");
64                $('body').css('overflow', 'hidden');
65                $('header.site-header.header-sticky').css('z-index', '1');
66
67                let badgesContainer = $bioPopup.find('.badges');
68                badgesContainer.addClass('badges-count-' + ((badges.length >= 3) ? 3 : badges.length));
69
70                for (let badge of badges) {
71                    let badgeTemplate = `<div class="badge badge-img-${badge}"></div>`;
72                    badgesContainer.append(badgeTemplate);
73                }
74            }
75        });
76    }
77});
78jQuery(function ($) {
79    "use strict";
80    $("#search-trigger, .search-trigger").click(function () {
81        $(".searchmain").toggleClass("showthis");
82        $(".search_input").focus();
83    });
84});
85
86jQuery(function ($) {
87    $("#submit-your-questions #submit-your-questions-here").removeClass("active");
88    $("#submit-your-questions .accordions .panel").css("max-height", "");
89});
90
91jQuery(function ($) {
92    $('.section-get-in-touch .gform_button').after('<span class="required-txt"><span>•</span> — Required fields</span>');
93    $(".section-get-in-touch .gfield_contains_required input[type='text']").after("<span class='required-dot'></span>");
94    $(".section-get-in-touch .gfield_contains_required input[type='email']").after("<span class='required-dot'></span>");
95});
96
97jQuery(function ($) {
98    var $masonry_container = $('.testimonial-blocks').imagesLoaded(function () {
99        $masonry_container.isotope({
100            itemSelector: '.grid-item',
101            percentPosition: true,
102            masonry: {
103                columnWidth: '.grid-sizer'
104            }
105        });
106    });
107});
108
109jQuery(function ($) {
110    var $masonry_container = $('.other-books .books').imagesLoaded(function () {
111        $masonry_container.isotope({
112            layoutMode: 'fitRows',
113            itemSelector: '.book',
114            percentPosition: true,
115            fitRows: {
116                gutter: '.grid-sizer'
117            }
118        });
119    });
120});
121
122jQuery(function ($) {
123    $(".wpmenucartli").removeClass("button");
124    if ($('.cartcontents').length === $('.cartcontents:contains("items")').length) {
125        $(".wpmenucartli span.cartcontents:contains('items')").html(function (_, html) {
126            return html.replace(/(items)/g, '<span style="display:none !important;">$1</span>');
127        });
128    } else if ($('.cartcontents').length === $('.cartcontents:contains("item")').length) {
129        $(".wpmenucartli span.cartcontents:contains('item')").html(function (_, html) {
130            return html.replace(/(item)/g, '<span style="display:none !important;">$1</span>');
131        });
132    }
133});
134
135jQuery(function ($) {
136    "use strict";
137    $('#respond .placeholder').click(function () {
138        $(this).siblings('input').focus();
139    });
140    $('#respond .form-control').focus(function () {
141        $(this).siblings('#respond .placeholder').hide();
142    });
143    $('#respond .form-control').blur(function () {
144        var $this = $(this);
145        if ($this.val().length === 0)
146            $(this).siblings('#respond .placeholder').show();
147    });
148    $('#respond .form-control').blur();
149});
150
151jQuery(function ($) {
152    "use strict";
153//Remove <p> tags from GF on contact page
154    $('.gform_wrapper p').contents().unwrap().siblings('p').remove();
155});
156
157jQuery(function ($) {
158    //Pulldown but now buttons
159    $btns = $('.btn-pulldown');
160    if ($btns.length < 1) return;
161    var is_hooked = false;
162    var unhook_clickout = function () {
163        is_hooked = false;
164        $(document.body).off('click', clickout);
165        $btns.removeClass('-open');
166    };
167    var clickout = function (e) {
168        if (e && $(e.target).closest('.btn-pulldown').length > 0) {
169            return;
170        }
171        unhook_clickout();
172        if ($btns.filter('.-open').length > 0) {
173            return false;
174        }
175    };
176    $btns.on('click', '.btn-pulldown-handle a', function (e) {
177        var $button = $(this).closest('.btn-pulldown');
178        $btns.not($button[0]).removeClass('-open');
179        $button.toggleClass('-open');
180        if ($btns.filter('.-open').length > 0) {
181            if (!is_hooked) {
182                is_hooked = true;
183                $(document.body).on('click', clickout);
184            }
185        } else {
186            unhook_clickout();
187        }
188        return false;
189    });
190});
191
192jQuery(function () {
193    "use strict";
194    init_signup_popup();
195
196    init_header_pulldown();
197
198    init_faq_accordion();
199
200    init_reveal_buttons();
201
202    init_adjust_header_spacer_size();
203});
204
205function init_adjust_header_spacer_size() {
206    let $spacer = jQuery('.header-spacer');
207    let $logo_bar = jQuery('.site-header .logo');
208
209    jQuery(window).resize(function () {
210        $spacer.css('height', $logo_bar.outerHeight() + 10);
211    }).trigger('resize');
212}
213
214/**
215 * Displays a popup once every 14 days after a given delay configurable in theme settings.
216 * To clear your cookie for the popup, just add #resetpopupcookie to any URL
217 */
218function init_signup_popup() {
219    let $promo = jQuery('#popup-promo');
220    if ($promo.length < 1) return;
221
222    let $overlay = jQuery('#popup-overlay');
223    let $close = jQuery('#popup-close');
224
225    // Show/hide the popup. When hiding, remember it was hidden via cookie
226    let showPopup = function () {
227        $overlay.css('display', '');
228        $promo.css('display', '');
229
230        if (jQuery(window).width() <= 768) {
231            $promo.css('top', jQuery(window).scrollTop() + 10);
232        } else {
233            $promo.css('top', '');
234        }
235    };
236
237    let closePopup = function () {
238        $overlay.css('display', 'none');
239        $promo.css('display', 'none');
240    };
241
242    jQuery('.cta-open-popup').on('click', function (e) {
243        showPopup();
244        return false;
245    });
246
247    // Clicking on background or close button will close the popup
248    $overlay.on('click', function (e) {
249        closePopup();
250        return false;
251    });
252
253    $close.click(function () {
254        closePopup();
255        return false;
256    });
257}
258
259/**
260 * Displays a popup once every 14 days after a given delay configurable in theme settings.
261 * To clear your cookie for the popup, just add #resetpopupcookie to any URL
262 */
263function init_header_pulldown() {
264    let $button = jQuery('#header-cta-button');
265    if ($button.length < 1) return;
266
267    let $header = jQuery('header');
268    let $cta = jQuery('#header-cta');
269    let $cta_inner = $cta.find('.inner');
270
271    $button.click(function (e) {
272        let visible = !$header.hasClass('pulldown-visible');
273
274        $cta.css('max-height', visible ? $cta_inner.outerHeight(true) : '');
275
276        $header
277            .toggleClass('pulldown-visible', visible)
278            .toggleClass('pulldown-hidden', !visible);
279
280        return false;
281    });
282}
283
284
285/* Utility functions */
286function aa_setCookie(c_name, value, exdays) {
287    let exdate = new Date();
288    exdate.setDate(exdate.getDate() + exdays);
289    let c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString());
290    document.cookie = c_name + "=" + c_value;
291}
292
293function aa_getCookie(c_name) {
294    let i, x, y, ARRcookies = document.cookie.split(";");
295    for (i = 0; i < ARRcookies.length; i++) {
296        x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
297        y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
298        x = x.replace(/^\s+|\s+$/g, "");
299        if (x === c_name) {
300            return unescape(y);
301        }
302    }
303}
304
305function aa_deleteCookie(name) {
306    document.cookie = name + '=;expires=Thu, 01 Jan 1970 00:00:01 GMT;';
307}
308
309
310function init_faq_accordion() {
311    let $faq = jQuery('#frequently-asked-questions');
312    if ($faq.length < 1) return;
313
314    let toggle_item = function ($item, activate) {
315        // Allow specifying active or closed with 2nd parameter, if not set then toggle
316        if (typeof activate === 'undefined') activate = $item.is('.-closed');
317
318        $item
319            .toggleClass('-open', activate)
320            .toggleClass('-closed', !activate);
321
322        $item.find('.faq-content').css('max-height', function () {
323            if (activate) return jQuery(this).find('.inner').outerHeight();
324            else return '';
325        });
326    };
327
328    $faq
329        .on('click', '.collapse, .expand', function (e) {
330            toggle_item(jQuery(this).closest('.faq-item'));
331            return false;
332        });
333
334    // Open the first item by default
335    /*$faq.find('.faq-item.-closed').first().each(function() {
336        toggle_item( jQuery(this), true );
337    });*/
338}
339
340function init_reveal_buttons() {
341    let $reveal_areas = jQuery('.after-content-reveal-button');
342    if ($reveal_areas.length < 1) return;
343
344    let transition_time = 0.2; // seconds
345
346    $reveal_areas.addClass('unrevealed');
347
348    $reveal_areas.on('click', 'a.reveal-button', function (e) {
349        let $container = jQuery(this).closest('.after-content-reveal-button');
350        let reveal_container = !$container.is('.revealed');
351
352        // let $button_row = $container.find('.reveal-button-row');
353        let $button = $container.find('.reveal-button');
354        let $content = $container.find('.reveal-content');
355
356        // store collapse button text
357        if (!$button.data('unfold-text')) $button.data('unfold-text', $button.text());
358
359        if (reveal_container) {
360            let height = $content.children('.inner').outerHeight(true);
361
362            $content.css('max-height', height).css('transition-duration: ' + transition_time + 's');
363            $container.addClass('revealed').removeClass('unrevealed');
364
365            $button.text('HIDE CONTENT');
366        } else {
367            $content.css('max-height', '');
368            $container.removeClass('revealed').addClass('unrevealed');
369
370            $button.text($button.data('unfold-text'));
371        }
372
373        return false;
374    });
375}
376
377/* Opens New Opt-in Popup */
378jQuery(function ($) {
379    "use strict";
380    $(".opt-in").click(function () {
381        $("#myModal").toggleClass("show");
382        $("#myModal").show();
383    });
384
385    $('.close').on("click", function () {
386        $(this).parents('#myModal').hide();
387    });
388});
389
390/*YOUI TESTIMONIAL SLIDER*/
391jQuery(function ($) {
392    'use strict';
393    $('#testimonials-slider .testimonials-slides').slick({
394        arrows: false,
395        dots: true,
396        slidesToShow: 1,
397        autoplay: true,
398        autoplaySpeed: 5000,
399        adaptiveHeight: true,
400    });
401});
402
403/*PRODUCT PAGE QUOTE CAROUSEL*/
404jQuery(function ($) {
405    'use strict';
406    $('.section-quote .quotes').slick({
407        arrows: false,
408        dots: true,
409        slidesToShow: 1,
410        autoplay: true,
411        autoplaySpeed: 5000,
412    });
413});
414
415/*HOME PAGE CAROUSEL*/
416jQuery(function ($) {
417    'use strict';
418    $('.section-carousel .slides').slick({
419        arrows: true,
420        dots: true,
421        centerMode: true,
422        centerPadding: '30px',
423        variableWidth: true,
424        variableHeight: true,
425        //adaptiveHeight: true,
426        prevArrow: '<div class="arrow-prev"></div>',
427        nextArrow: '<div class="arrow-next"></div>',
428        slidesToShow: 1,
429        autoplay: true,
430        autoplaySpeed: 5000,
431        responsive: [
432            {
433                breakpoint: 1025,
434                settings: {
435                    arrows: true,
436                    dots: true
437                }
438            },
439            /*{
440                breakpoint: 600,
441                settings: "unslick"
442            },*/
443            {
444                breakpoint: 575,
445                settings: {
446                    arrows: false,
447                    dots: true
448                }
449            }
450        ]
451    });
452});
453
454/*NEW ABOUT PAGE CAROSEL*/
455jQuery(function ($) {
456    'use strict';
457    $('.section-photo-slider .photo-slider').slick({
458        arrows: true,
459        dots: true,
460        focusOnSelect: true,
461        centerPadding: '60px',
462        prevArrow: '<div class="photo-arrow-prev"></div>',
463        nextArrow: '<div class="photo-arrow-next"></div>',
464        slidesToShow: 1,
465        slidesToScroll: 1,
466        adaptiveHeight: true,
467        centerMode: true,
468        variableHeight: true,
469        variableWidth: true,
470        responsive: [
471            {
472                breakpoint: 991,
473                settings: {
474                    arrows: false,
475                    dots: true
476                }
477            },
478            {
479                breakpoint: 575,
480                settings: {
481
482                    arrows: false,
483                    dots: true
484                }
485            }
486        ]
487    });
488});
489
490/*SPEAKING PAGE CAROSEL*/
491jQuery(function ($) {
492    'use strict';
493    $('.section-book-slider .books-slider').slick({
494        arrows: true,
495        dots: false,
496        //focusOnSelect: true,
497        //centerPadding: '60px',
498        prevArrow: '<div class="photo-arrow-prev"></div>',
499        nextArrow: '<div class="photo-arrow-next"></div>',
500        slidesToShow: 4,
501        slidesToScroll: 4,
502        adaptiveHeight: true,
503        //centerMode: true,
504        //variableHeight:true,
505        //variableWidth: true,
506        responsive: [
507            {
508                breakpoint: 1430,
509                settings: {
510                    arrows: false,
511                    dots: true
512
513                }
514            },
515            {
516                breakpoint: 1199,
517                settings: {
518                    slidesToShow: 3,
519                    slidesToScroll: 3,
520                    arrows: false,
521                    dots: true
522
523                }
524            },
525            {
526                breakpoint: 991,
527                settings: {
528                    slidesToShow: 3,
529                    slidesToScroll: 3,
530                    arrows: false,
531                    dots: true
532                }
533            },
534            {
535                breakpoint: 767,
536                settings: {
537                    slidesToShow: 2,
538                    slidesToScroll: 2,
539                    arrows: false,
540                    dots: true
541                }
542            },
543            {
544                breakpoint: 575,
545                settings: {
546					slidesToShow: 1,
547                    slidesToScroll: 1,
548                    arrows: false,
549                    dots: true
550                }
551            }
552        ]
553    });
554});
555
556/*WRITE TO LIGHT JS*/
557/*(function ($) {
558
559    $(document).ready(function () {
560
561        $('#signup-trigger').on('click', function (e) {
562            e.preventDefault();
563
564            var $signup = $('#header-signup');
565
566            if ($signup.hasClass('open')) {
567                $signup.removeClass('open');
568            } else {
569                $signup.addClass('open');
570            }
571        });
572
573        // Add smooth scrolling to all links
574        $("a").on('click', function (event) {
575
576            // Make sure this.hash has a value before overriding default behavior
577            if (this.hash !== "" && this.hash.indexOf("marthabeck.com") !== -1) {
578                // Prevent default anchor click behavior
579                event.preventDefault();
580
581                // Store hash
582                var hash = this.hash;
583
584                // Using jQuery's animate() method to add smooth page scroll
585                // The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
586                $('html, body').animate({
587                    scrollTop: $(hash).offset().top
588                }, 800, function () {
589
590                    // Add hash (#) to URL when done scrolling (default click behavior)
591                    window.location.hash = hash;
592                });
593            } // End if
594        });
595
596        // This adjusts the progress bar percentage to it's equivalent position along the bar.
597        // WILL NEED UPDATED IF MULTIPLE PROGRESS BARS ON ONE PAGE
598        var percentage = $('.progressally_progress_bar_percentage')
599        var progress = $('.progressally_progress_bar_overlay').css('width');
600        //var setLeft = parseInt(progress) - 20 + 'px';
601        percentage.css('margin-left', progress);
602
603        function progressPercentage() {
604            var percentage = $('.progressally_progress_bar_percentage');
605            var progress = $('.progressally_progress_bar_overlay').css('width');
606            //var setLeft = parseInt(progress) - 20 + 'px';
607            percentage.css('margin-left', progress);
608            percentage.fadeIn('fast');
609        }
610
611        $('.objective-completion label').on('click', function () {
612            var percentage = $('.progressally_progress_bar_percentage')
613            percentage.fadeOut('fast');
614            setTimeout(progressPercentage, 1500);
615        });
616
617        $('.video-playlist-link').on('click', function (e) {
618            e.preventDefault();
619            var $this = $(this);
620            var $playlist = $this.parents('.video-playlist').data('playlist');
621            var $target = $this.data('target');
622
623            $('#video-playlist-' + $playlist + ' .video-playlist-link').removeClass('active');
624            $this.addClass('active');
625            $('#section-' + $playlist + '-videos .video-panel').fadeOut();
626            $($target).fadeIn();
627        });
628
629        $(window).load(function () {
630            $('.video-wrap').removeClass('loading');
631        });
632
633    }); // document.ready()
634
635})(jQuery); */
636
637
638/*  -------------------------------------------------------------
639		DEFAULT JS FUNCTIONS BELOW THIS LINE
640------------------------------------------------------------- */
641/*SLIDE OUT MENU*/
642jQuery(function ($) {
643    // Slideout Menu
644    "use strict";
645    $('#slideout-trigger').on('click', function (event) {
646        event.preventDefault();
647        // create menu variables
648        var slideoutMenu = $('#slideout-menu');
649        var slideoutMenuWidth = $('#slideout-menu').outerWidth();
650
651        // toggle open class
652        slideoutMenu.toggleClass("open");
653
654        // slide menu
655        if (slideoutMenu.hasClass("open")) {
656            slideoutMenu.animate({
657                right: "0px"
658            });
659        } else {
660            slideoutMenu.animate({
661                right: -slideoutMenuWidth
662            }, 250);
663        }
664    });
665
666    $('#nav-close').on('click', function (event) {
667        event.preventDefault();
668        // create menu variables
669        var slideoutMenu = $('#slideout-menu');
670        var slideoutMenuWidth = $('#slideout-menu').outerWidth();
671
672        // toggle open class
673        slideoutMenu.toggleClass("open");
674
675        // slide menu
676        if (slideoutMenu.hasClass("open")) {
677            slideoutMenu.animate({
678                right: "0px"
679            });
680        } else {
681            slideoutMenu.animate({
682                right: -slideoutMenuWidth
683            }, 250);
684        }
685    });
686
687    $('#content-wrapper').on('click', function () {
688        // create menu variables
689        var slideoutMenu = $('#slideout-menu');
690        var slideoutMenuWidth = $('#slideout-menu').outerWidth();
691
692        // toggle open class
693        slideoutMenu.removeClass("open");
694
695        // slide menu
696        slideoutMenu.animate({
697            right: -slideoutMenuWidth
698        }, 250);
699
700    });
701
702    /*SLIDE OUT MENU DROPDOWN*/
703    $('#slideout-nav .sub-menu').before('<div id="submenu-link"></div>');
704    $('#slideout-menu ul ul').hide();
705    if ($('#slideout-menu .menu-item-has-children').length > 0) {
706        $('#slideout-menu .menu-item-has-children').click(
707            function () {
708                $(this).addClass('toggled');
709                if ($(this).hasClass('toggled')) {
710                    $(this).children('ul').slideToggle();
711                }
712                //return false;
713
714            });
715    }
716});
717
718//Scrolling Anchor Link
719jQuery(function ($) {
720    "use strict";
721    $('a[href*="#"]:not([href="#"])').click(function () {
722        if (
723            location.pathname.replace(/^\//, "") ===
724                this.pathname.replace(/^\//, "") ||
725            location.hostname === this.hostname
726        ) {
727            var target = $(this.hash);
728            target = target.length
729                ? target
730                : $("[name=" + this.hash.slice(1) + "]");
731            if (target.length) {
732                // Check if we're on the Mentoring for Wayfinders page
733                if ($("body").hasClass("page-template-template_wayfinder_mentor") || $("body").hasClass("page-template-template_mb_webinar_page") || $("body").hasClass("african-star-page") || $("body").hasClass("page-template-template_new_wlct_page") || $("body").hasClass("single-post") || $("body").hasClass("page")){
734                    // For Mentoring for Wayfinders page, don't adjust for sticky nav
735                    $("html,body").animate(
736                        {
737                            scrollTop: target.offset().top,
738                        },
739                        1000
740                    );
741                } else {
742                    // Use the original logic for all other pages
743                    $("html,body").animate(
744                        {
745                            scrollTop:
746                                target.offset().top -
747                                jQuery("#mysticky-nav").height(),
748                        },
749                        1000
750                    );
751                }
752                return false;
753            }
754        }
755    });
756});
757
758
759//Move Text Below Mobile Image Flex Layout
760jQuery(function ($) {
761    "use strict";
762    $(".cls-mobile-image.before-txt").each(function () {
763        $(this).closest(".layout-section").find(".background_mobile-mobile-image-before .cls-inner").prepend(this);
764    });
765});
766
767
768//Fancy Credits
769jQuery(function ($) {
770    "use strict";
771    $("#credit-trigger").on("click", function (e) {
772        e.preventDefault();
773        console.log('click');
774        if ($('#credit-trigger').hasClass("credit-open") || $('#credit-close').hasClass("credit-open")) {
775            $('#credit-trigger').removeClass("credit-open");
776            $('#credit-close').removeClass("credit-open");
777            $("#creditslide").removeClass("credit-open");
778        } else {
779            $('#credit-trigger').addClass("credit-open");
780            $('#credit-close').addClass("credit-open");
781            $("#creditslide").addClass("credit-open");
782            $("#creditslide").show();
783        }
784    });
785
786    $("#credit-close").on("click", function (e) {
787        e.preventDefault();
788        console.log('click');
789        if ($('#credit-trigger').hasClass("credit-open") || $('#credit-close').hasClass("credit-open")) {
790            $('#credit-trigger').removeClass("credit-open");
791            $('#credit-close').removeClass("credit-open");
792            $("#creditslide").removeClass("credit-open");
793        } else {
794            $('#credit-trigger').addClass("credit-open");
795            $('#credit-close').addClass("credit-open");
796            $("#creditslide").addClass("credit-open");
797            $("#creditslide").show();
798        }
799    });
800
801});
802
803//New FAQ for WIL
804if (jQuery(".toggle .toggle-title").hasClass('active')) {
805    jQuery(".toggle .toggle-title.active").closest('.toggle').find('.toggle-inner').show();
806}
807jQuery(".toggle .toggle-title").click(function () {
808    if (jQuery(this).hasClass('active')) {
809        jQuery(this).removeClass("active").closest('.toggle').find('.toggle-inner').slideUp(200);
810    } else {
811        jQuery(this).addClass("active").closest('.toggle').find('.toggle-inner').slideDown(200);
812    }
813});
814//Open first FAQ toggle
815jQuery(function ($) {
816    "use strict";
817    $(".toggle .toggle-title:first").addClass("active");
818    $(".toggle .toggle-title.active").closest('.toggle').find('.toggle-inner').show();
819});
820
821
822// The Art of Calm FAQ
823jQuery(function ($) {
824    "use strict";
825    //$('.taoc-faq .faq-title a.expand').attr('href','javascript:void(0)');
826    $('.taoc-faq .faq-title').on('click', function(){
827      $(this).parents('.faq-item').toggleClass('open').find('.faq-content').slideToggle();
828    });
829});
830
831
832var acc = document.getElementsByClassName("accordion");
833var i;
834
835for (i = 0; i < acc.length; i++) {
836    acc[i].addEventListener("click", function () {
837        this.classList.toggle("active");
838        var panel = this.nextElementSibling;
839        if (panel.style.maxHeight) {
840            panel.style.maxHeight = null;
841        } else {
842            panel.style.maxHeight = panel.scrollHeight + "px";
843        }
844    });
845}
846
847// The Art of Calm Mini Book Slides
848jQuery(function ($) {
849    $slideshow = $('.mini-book-slides').slick({
850		dots:true,
851		slidesToShow:1,
852		slidesToScroll:1
853	});
854	$('.mini-book-slide').click(function() {
855		$slideshow.slick('slickGoTo', parseInt($slideshow.slick('slickCurrentSlide'))+1);
856	});
857});
858
859
860
861// Pure.Wild.Self Retreat Accommodation Pop-ups
862jQuery(function ($) {
863    $('.section-accommodations__room').each(function() {
864        var link = $(this).find('.section-accommodations__desc a.moredetails'),
865            popup = $(this).find('.section-accommodations__details'),
866            close = popup.find('.section-accommodations__details__close');
867
868        link.on('click', function(e) {
869            e.preventDefault();
870            popup.toggle().toggleClass('open');
871        });
872
873        close.on('click', function(e) {
874            e.preventDefault();
875            popup.hide().removeClass('open');
876        });
877    });
878});
879
880
881/*STICKY HEADER*/
882jQuery(function($) {
883	var headerHeight = $('#header-wrapper.sticky-header').outerHeight() + 50;
884	if (!$('body').hasClass('page-template-template-thanks-v3')) {
885	$('#content-wrapper').css('padding-top', headerHeight);
886	}
887});
888
889jQuery(function($) {
890    // Check if the viewport width is less than or equal to a typical mobile breakpoint (e.g., 768px)
891    if ($(window).width() <= 768) {
892        // Select all anchor tags (links)
893        $('.home a').each(function() {
894            // Set the target attribute to "_self"
895            $(this).attr('target', '_self');
896        });
897    }
898});

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.