1/////////////////////////////////////// 2// MUM Master JS - Version 3.4 3// by Alek Lisefski 4// http://www.bluesheepstudios.com 5/////////////////////////////////////// 6 7jQuery(function ($) { 8 9 // clear search default text on focus 10 $(".clearDefault").focus(function() { 11 if( this.value == this.defaultValue ) { 12 this.value = ""; 13 } 14 }).blur(function() { 15 if( !this.value.length ) { 16 this.value = this.defaultValue; 17 } 18 }); 19 20 // Submit forms with links 21 $(".submit").click(function(){ 22 // if($(this).closest("form")[0].childNodes[1].value === ''){ 23 // return false; 24 // } 25 $(this).closest("form").submit(); 26 return false; 27 }); 28 $('form input').keypress(function(e){ 29 var c = e.which ? e.which : e.keyCode; 30 if(c == 13){ 31 $(this).closest('form').submit(); 32 } 33 }); 34 35 $('.show-on-page-load').removeClass('hidden'); 36 37 // Highlight active menu item when not an actual link 38 $(document).on('click', '.menu-highlight', function () { 39 $(this).toggleClass('current_page_item'); 40 }); 41 42 function smoothScroll() { 43 var el = $(this), 44 target = el.attr('href'); 45 var topScroll = 40; 46 if(jQuery('#CUSOURCE').val().includes('10857_Visit')){ 47 topScroll = 65; 48 }else{ 49 topScroll = 40; 50 } 51 $('html, body').animate({ 52 scrollTop: $(target).offset().top - topScroll 53 }, 500); 54 } 55 56 $('body').on('click', '.smoothScroll', smoothScroll); 57 58 59 60 61 // Home page slides 62 $( '#hero .slider' ).on( 'cycle-before', function(e, optionHash, outgoingSlideEl, incomingSlideEl, forwardFlag ) { 63 $('#hero .slider.desktop-only .slide .slide-info').stop().animate({ 64 opacity: 0, 65 right: '0' 66 }, 250 67 ); 68 }); 69 $( '#hero .slider' ).on( 'cycle-after', function(e, optionHash, outgoingSlideEl, incomingSlideEl, forwardFlag ) { 70 $('#hero .slider.desktop-only .slide .slide-info').stop().fadeOut(0).animate({ 71 opacity: 100, 72 right: '10%' 73 }, 500 74 ).fadeIn(250); 75 }); 76 77 // All Sliders 78 $( '.grid.thirds .slider' ).on( 'cycle-before', function(e, optionHash, outgoingSlideEl, incomingSlideEl, forwardFlag ) { 79 $('.grid.thirds .slider .slide').stop().show(); 80 equalHeight(); 81 }); 82 $( '.grid.thirds .slider' ).on( 'cycle-after', function(e, optionHash, outgoingSlideEl, incomingSlideEl, forwardFlag ) { 83 equalHeight(); 84 }); 85 86 //Sticky Nav 87 stickyTopNav = function() { 88 var header = $('.nav-desktop .nav-tablet .nav-mobile'), 89 stickyHeader = $('.sticky-topnav'), 90 stickyFooter =$('.sticky-footer'), 91 scroll = $(window).scrollTop(); 92 93 //desktop 94 if (scroll >= 125) { 95 header.addClass('hidden'); 96 stickyHeader.removeClass('hidden'); 97 stickyFooter.removeClass('hidden'); 98 // headerLogo.addClass('hidden'); 99 } 100 else { 101 header.removeClass('hidden'); 102 stickyHeader.addClass('hidden'); 103 stickyFooter.addClass('hidden'); 104 // headerLogo.removeClass('hidden'); 105 } 106 }; 107 108 $(window).scroll(stickyTopNav); 109 110 111 // Full-width Dropdown 112 $("#nav").hide(); 113 $("nav.desktop li").not(".current").click(function() { 114 var dropDownId = $(this).find("a").attr('href'); 115 var inactive = $("#nav.desktop section").not(dropDownId); 116 var thisLink = $(this); 117 $(".popUp").slideUp(150); 118 $(inactive).fadeOut(0); 119 $(dropDownId).fadeIn(250); 120 $("#nav.desktop").slideDown(250); 121 $(dropDownId).fadeIn(250, function() { 122 $("nav li").removeClass("current"); 123 $(thisLink).addClass("current"); 124 }); 125 return false; 126 }); 127 128 $("nav li.current a").click(function() { 129 var dropDownId = $(this).attr('href'); 130 $(dropDownId).fadeIn(0); 131 return false; 132 }); 133 134 $(".dropDown .close").click(function() { 135 $("#nav.desktop").slideUp(250, function() { 136 $("nav.desktop li").removeClass("current"); 137 }); 138 return false; 139 }); 140 141 // Anywhere Dropdown 142 $("body").on("click", ".toggle", function() { 143 var objToggleBox = undefined; 144 if($(this).parent().find('.toggle-box').length) { 145 objToggleBox = $(this).parent().find('.toggle-box').first(); 146 } else { 147 objToggleBox = $(this).parent().next('.toggle-box'); 148 } 149 // if($(this).parent().is("p")) { 150 // objToggleBox = $(this).parent().next(".toggle-box"); 151 // } 152 // else { 153 // objToggleBox = $(this).next(".toggle-box"); 154 // } 155 // //drop down for h2, h3, h4 and li 156 // if(($(this).parent().is("h3") || $(this).parent().is("h4") || $(this).parent().is("h2") || $(this).parent().is("li")) && $(this).parent().hasClass("drop-down")) { 157 // objToggleBox = $(this).parent().next(".toggle-box"); 158 // } 159 var isVisible = !$(objToggleBox).is(":visible"); 160 $(objToggleBox).slideToggle(); 161 if (isVisible) { 162 $(this).addClass('selected'); // use *this*, because it is the selector for the onclick event of this function, and it is the element we want .selected added to 163 $(this).attr('aria-expanded', 'true'); 164 } 165 else { 166 $(this).removeClass('selected'); 167 $(this).attr('aria-expanded', 'false'); 168 } 169 }); 170 171 // Mobile Nav // 172 $("#nav.mobile").hide(); 173 $("#nav.mobile li ul").hide(); 174 $("#nav-open").click(function() {
175 $(".popUp").slideUp(150); 176 $("#nav.mobile").slideDown(300); 177 $(this).hide(); 178 $("#nav-close").show(); 179 return false; 180 }); 181 $("#nav.mobile li > a.top").click(function() { 182 var dropDown = $(this).parent().find("ul"); 183 var dropDownId = $(this).attr('href'); 184 var inactive = $("#nav.mobile li ul").not(dropDownId); 185 var thisLink = $(this).parent(); 186 $(".popUp").slideUp(150); 187 $("#nav.mobile ul li").removeClass("current"); 188 $(inactive).slideUp(200); 189 $(dropDown).slideDown(200); 190 $(thisLink).addClass("current"); 191 return false; 192 }); 193 194 195 $("#nav.mobile li ul .close").click(function() { 196 var dropDown = $(this).parent(); 197 $(dropDown).slideUp(200); 198 $("#nav.mobile ul li").removeClass("current"); 199 return false; 200 }); 201 202 $("#nav-close").click(function() { 203 $(".popUp").slideUp(150); 204 closeMobileNav(); 205 return false; 206 }); 207 208 closeMobileNav = function() { 209 $("#nav.mobile ul li").removeClass("current"); 210 $("#nav.mobile li ul").fadeOut(100); 211 $("#nav.mobile").slideUp(500); 212 $("#nav-open").show(); 213 $("#nav-close").hide(); 214 }; 215 216 217 // Top Nav PopUps
218 $("header .topNav div.anchor").click(function() { 219 var current = $(this).find(".popUp"); 220 $(current).addClass("current"); 221 var notCurrent = $(".popUp").not(current); 222 $(notCurrent).slideUp(150); 223 $(current).slideDown(150); 224 }); 225 $(".popUp .close").click(function() { 226 var current = $(this).closest(".popUp"); 227 $(current).slideUp(150); 228 return false; 229 }); 230 231 // Subnav // 232 233 // add "parent" class to top level categories 234 235 $('li.cat-item:has(ul.children)').addClass('parent'); 236 var parent = $("#subnav li.parent a").not('#subnav li.parent li a'); 237 238 $(parent).unbind('click').click(function(){ 239 var activeSub = $(this).parent().find("ul"); 240 $(activeSub).slideToggle(200, function(){ 241 getTopOffset(); 242 }); 243 if ($(this).parent().hasClass( "open" )) { 244 $(this).parent().removeClass('open'); 245 } else { 246 $(this).parent().addClass('open'); 247 } 248 return false; 249 }); 250 251 openActiveParent = function() { 252 var activeParent = $("#subnav li.current_page_parent, #subnav li.current-cat-parent, #subnav li.cat-item.parent"); 253 var activeSub = $(activeParent).find("ul"); 254 $(activeParent).addClass('open'); 255 $(activeSub).slideDown(200, function(){ 256 getTopOffset(); 257 }); 258 }; 259 260 // Mobile Subnav 261 $(document).on('click','.collapse', function() { 262 var el = $(this), 263 target = $(el.data('collapse')); 264 265 target.slideToggle(200); 266 }); 267 268 // $("#sub-open").click(function() { 269 // $("aside").animate({right:"0"}, 250); 270 // $(this).hide(); 271 // $("#sub-close").show(); 272 // return false; 273 // }); 274 275 // closeSubNav = function() { 276 // var navWidth = $("aside.body-subnav").width() + 5; 277 // $("aside").animate({right:-navWidth}, 250, function() { 278 // $("#sub-open").show(); 279 // $("#sub-open").css({left:"0"}); 280 // $("#sub-open").animate({left:"-55"}); 281 // $("#sub-close").hide(); 282 // }); 283 // $("#subnav li ul").slideUp(200); 284 // // $("#subnav li.parent").removeClass('open'); 285 // }; 286 287 $("#sub-close").on('click', function() { 288 // closeSubNav(); 289 return false; 290 }); 291 292 // On window resize 293 $(window).resize(function() { 294 widthResize(); 295 equalHeight(); 296 sharePosition(); 297 }); 298 299 //mobile fix iOS 10 disabled user-scalable, mobile unexpectedly fires resize on tap/scroll 300 var screenWidth = window.innerWidth; 301 // Show / Hide nav based on screen width 302 setSubnavDesktop = function() { 303 closeMobileNav(); 304 $("aside").animate({right:"0"}, 100); 305 } 306 307 setLinksDesktop = function() { 308 $("#hero .slider").addClass("desktop-only"); 309 // Do not allow some links to be clicked - only on desktop 310 $('a[title="noAnchor"]').click(false); 311 } 312 313 setSubnavMobile = function() { 314 $("#nav.desktop").hide(); 315 // $("aside").animate({right:"-325"}, 100); 316 // $("#sub-open").show(); 317 // $("#sub-open").animate({left:"-55"}); 318 } 319 320 setLinksMobile = function() { 321 $('a[title="noAnchor"]').click(true); 322 } 323 324 widthResize = function() { 325 var screen_width = window.innerWidth; 326 if (screenWidth === screen_width) { 327 return; 328 } 329 if (screen_width > 1023) { 330 setSubnavDesktop(); 331 setLinksDesktop(); 332 } else { 333 setSubnavMobile(); 334 setLinksMobile(); 335 } 336 sharePosition(); 337 getTopOffset(); 338 }; 339 340 341 // position social sharing 342 sharePosition = function() { 343 $window = window.innerWidth; 344 if( $window < 1300 ) { 345 $('#sharing').hide(); 346 $('#sharing-inline').show(); 347 } else { 348 $('#sharing-inline').hide(); 349 $('#sharing').show(); 350 } 351 }; 352 353 // Style Select Menu Drop-downs 354 selectStyling = function() { 355 //console.log("In init.js, in selectStyling: top"); 356 $.each($('.contactForm select'), function () { 357 //console.log("In init.js, in selectStyling: top of each .contactForm select"); 358 $(this).selectmenu({ 359 width : $(this).parent().width() 360 //change: function() { 361 // $("#contact-form").validate().element(this); 362 //} 363 }).selectmenu( "widget" ).addClass( "con" ); 364 }); 365 366 $.each($('.visitors-weekend-dates select'), function () { 367 $(this).selectmenu({ 368 width : $(this).parent().width() 369 }).selectmenu( "widget" ).addClass( "vw" ); 370 }); 371 372 $.each($('.slide-info.download.blue select'), function () { 373 $(this).selectmenu({ 374 width : $(this).parent().width() 375 }).selectmenu( "widget" ).addClass( "interest" ); 376 }); 377 378 $.each($('#contact-form-cuthankyoudvd select'), function () { 379 $(this).selectmenu({ 380 width : $(this).parent().width(), 381 change: function() { 382 $("#contact-form-cuthankyoudvd").validate().element
382(this); 383 } 384 }).selectmenu( "widget" ).addClass( "app" ); 385 }); 386 387 $.each($('.form select'), function () { 388 $(this).selectmenu({ 389 width : $(this).parent().width() 390 }).selectmenu( "widget" ).addClass( "app" ); 391 }); 392 393 $.each($('.gform_wrapper select'), function () { 394 $(this).selectmenu({ 395 width : $(this).parent().width() 396 }).selectmenu( "widget" ).addClass( "app" ); 397 }); 398 399 }; 400 401 // Show/Hide Contact Form 402 $(".contact .anchor.contact").not('.fancybox-contact').unbind('click').click(function(){ 403 //console.log("In init.js: top of .contact et al, not fancybox-contact, unbind click"); 404 var button = $(this); 405 if (button.hasClass( "current" )) { 406 $(button).removeClass('current'); 407 closeContact(); 408 } else { 409 $(button).addClass('current'); 410 openContact(); 411 } 412 return false; 413 }); 414 415 416 //$('header .contact li.first a, .box.green .icons li.contact a, .green.contact a.contact').click(function() { 417 // openContact(); 418 // return false; 419 //}); 420 421 openContact = function() { 422 //console.log("In init.js: top of openContact"); 423 $(".contact .anchor.contact").addClass('current'); 424 $("#form-footer").slideDown(250, function() { 425 selectStyling(); 426 }); 427 }; 428 429 closeContact = function() { 430 //console.log("In init.js: top of closeContact"); 431 $(".contactForm").slideUp(250); 432 $(".contact .anchor.contact").removeClass('current'); 433 }; 434 435 $(".contactForm .close").click(function() { 436 closeContact(); 437 return false; 438 }); 439 440 //closing contact popup clears form and errors 441 // 7/4/2018 Ron commented out the call to this function 442 clearFormOnClose = function() { 443 //console.log("In init.js: top of clearFormOnClose"); 444 //necessary because form uses value instead of placeholder 445 var defaultValues = { 446 'firstName': 'First Name *', 447 'lastName': 'Last Name *', 448 'email': 'Email Address *', 449 'phone2': 'Phone Number *', 450 'phone3': 'Best Phone Number *', 451 452 }; 453 var form = $('#conact-popup').find('form'); 454 if (form.length && form.hasClass('contact-compact')) { 455 //console.log("In init.js: clearFormOnClose, found a form"); 456 form.find('label.error').remove(); 457 form.find('input:radio').prop('checked', false); 458 form.find('#textme').prop('checked', true); 459 form.find('textarea').val(''); 460 form.find('input, textarea').removeClass('error').attr('aria-invalid', false); 461 } 462 463 $.each(defaultValues, function(i,v) { 464 form.find('input[name='+i+']').val(v); 465 }); 466 }; 467 468 // Smooth Scroll to contact form 469 // 1/1/2017 Commented out by Ron P because it raises an error: Object doesn't support property or method 'localScroll'. Seems to not be needed now that the contact form is a popup. 470 //$('header .contact li.scroll').localScroll({ 471 // target: $(window), 472 // axis: 'y', 473 // offset: 0, 474 // duration: 1000, 475 // easing: 'easeOutQuad', 476 // hash: false 477 //}); 478 479 480 getTopOffset = function() { 481 share_offset = 0; 482 bottom_offset = $('footer').offset().top -750; 483 related_offset = 0; 484 subscribe_offset = 0; 485 subscribe_width = 0; 486 487 if ($("#sharing").is('*')) { 488 share_offset = $('#sharing').offset().top -40; 489 } 490 491 if ($("#subscribe").is('*')) { 492 subscribe_offset = $('#subscribe').offset().top -40; 493 subscribe_width = $('#subscribe').width(); 494 if ($("#related-posts").is('*')) { 495 related_offset = $('#related-posts').offset().top -400; 496 } else { 497 related_offset = bottom_offset; 498 } 499 500 } 501 }; 502 503 // scroll smoothly back to top of App when next/prev buttons clicked 504 // 1/1/2017 Commented out by Ron P because it raises an error: Object doesn't support property or method 'localScroll'. Seems to not be needed now that the contact form is a popup. 505 //$('.call-out .grid.half .item').localScroll({ 506 // target: $(window), 507 // axis: 'y', 508 // offset: 30, 509 // duration: 500, 510 // easing: 'easeOutQuad', 511 // hash: false 512 //}); 513 514 // Make things sticky when scrolled 515 $(window).scroll(function() { 516 var screen_width = window.innerWidth; 517 var scroll_top = $(window).scrollTop(); 518 519 // Fixed Social Sharing; 520 521 if (scroll_top > share_offset) { 522 $('#sharing').addClass('fixed'); 523 } else { 524 $('#sharing').removeClass('fixed'); 525 } 526 527 //screen width stuff here 528 529 if (screen_width > 1300) { 530 531 if (scroll_top > subscribe_offset) { 532 $('#subscribe').addClass('fixed'); 533 $('#subscribe').animate({width : subscribe_width}, 0); 534 } else { 535 $('#subscribe').removeClass('fixed'); 536 } 537 538 if (scroll_top > bottom_offset) { 539 $('#sharing').fadeOut(250); 540 } else { 541 if (screen_width > 1300) { 542 $('#sharing').fadeIn(250); 543 } 544 } 545 546 if (scroll_top > related_offset) { 547 $('#subscribe').fadeOut(250); 548 } else { 549 $('#subscribe').animate({width : subscribe_width}, 0); 550 $('#subscribe').fadeIn(250); 551 } 552 } 553 554 }); 555 556 // make all boxes the same height 557 equalHeight = function() { 558 //var maxHeight = -1; 559 560 $('.equalHeight').each(function() { 561 $item = $(this).find('.item'); 562 $heading = $item.find('h3'); 563 $heading.matchHeight(); 564 }); 565 566 $('.slide').each(function() { 567 $item = $(this).find('.item'); 568 $heading = $item.find('h3'); 569 $heading.matchHeight(); 570 }); 571 572 573 //$('.slide').each(function(i) { 574 // $boxHeadings = $(this).find('.item .h3'); 575 // maxHeight(i) = maxHeight > $boxHeadings.height() ? maxHeight : $boxHeadings.height(); 576 //}); 577 578 //$('.slide').each(function() { 579 // $boxHeadings.height(maxHeight); 580 //}); 581 }; 582 583 // FAQs 584 $('.faq h4 a').click(function() { 585 $parent = $(this).closest('.faq'); 586 $inactiveAnswer = $('.faq').not($parent).find('.answer'); 587 $inactiveLink = $('.faq').not($parent).find('h4 a'); 588 589 $inactiveAnswer.slideUp(250); 590 $inactiveLink.removeClass('open'); 591 $content = $parent.find('.answer'); 592 $content.slideToggle(250); 593 $(this).toggleClass('open'); 594 return false;
595 }); 596 597 // Disable Event Venue and Organizer Links 598 $('.fn.org a').click(false); 599 600 601 // Department Download / Subscribe Box 602 $('.download .description a.button').click(function() { 603 $parent = $('.download .description'); 604 $form = $('.download .form'); 605 $parent.hide(); 606 $form.fadeIn(200); 607 return false; 608 }); 609 610 611 /* 612 Fancybox -- Videos 613 */ 614 615 $('.fancybox-media').fancybox({ 616 openEffect : 'elastic', 617 openSpeed : 150, 618 closeEffect : 'elastic', 619 closeSpeed : 150, 620 closeClick : false, 621 width : 853, 622 height : 480, 623 helpers : { 624 media : {} 625 } 626 }); 627 628 629 $('.fancybox-responsive-media').fancybox({ 630 openEffect : 'elastic', 631 openSpeed : 150, 632 closeEffect : 'elastic', 633 closeSpeed : 150, 634 closeClick : false, 635 maxWidth: "1200", 636 fitToView: true, 637 Height: 900, 638 type: 'iframe', 639 aspectRatio: true, 640 autoSize : true, 641 'loop' : false, 642 'scrolling' : 'no', 643 'iframe' : {'scrolling': 'yes'} 644 }); 645 646 647 $('.fancybox-responsive-media-tall').fancybox({ 648 openEffect : 'elastic', 649 openSpeed : 150, 650 closeEffect : 'elastic', 651 closeSpeed : 150, 652 closeClick : false, 653 maxWidth: "800", 654 fitToView: true, 655 Height: 1200, 656 type: 'iframe', 657 aspectRatio: true, 658 autoSize : true, 659 'loop' : false, 660 'scrolling' : 'no', 661 'iframe' : {'scrolling': 'yes'} 662 }); 663 664 $('.fancybox-fixedheightwidth').fancybox({ 665 openEffect : 'elastic', 666 openSpeed : 150, 667 closeEffect : 'elastic', 668 closeSpeed : 150, 669 closeClick : false, 670 width: 800, 671 fitToView: false, 672 height : 560, 673 type: 'iframe', 674 autoSize : false, 675 'loop' : false 676 }); 677 678 $('.fancybox-seventwentybytwothirty').fancybox({ 679 openEffect : 'elastic', 680 openSpeed : 150, 681 closeEffect : 'elastic', 682 closeSpeed : 150, 683 closeClick : false, 684 width: 720, 685 fitToView: false, 686 height : 230, 687 type: 'iframe', 688 autoSize : false, 689 'loop' : false 690 }); 691 692 $('.fancybox-video-stories').fancybox({ 693 openEffect : 'elastic', 694 openSpeed : 150, 695 closeEffect : 'elastic', 696 closeSpeed : 150, 697 closeClick : false, 698 maxWidth: "800", 699 fitToView: true, 700 Height: 800, 701 type: 'iframe', 702 aspectRatio: true, 703 autoSize : true, 704 'loop' : false, 705 'scrolling' : 'no', 706 'iframe' : {'scrolling': 'yes'} 707 }); 708 709 $('.fancybox-mobile').fancybox({ 710 openEffect : 'elastic', 711 openSpeed : 150, 712 closeEffect : 'elastic', 713 closeSpeed : 150, 714 closeClick : false, 715 width : 300, 716 height : 500, 717 type: 'iframe', 718 autoSize : false 719 // 7/4/2018 commented out by Ron so that entered values stay there, even when opening and closing the form 720 //autoSize : false, 721 //afterClose: function() { 722 // clearFormOnClose(); 723 //} 724 }); 725 $('.fancybox-mobile-app-choice').fancybox({ 726 openEffect : 'elastic', 727 openSpeed : 150, 728 closeEffect : 'elastic', 729 closeSpeed : 150, 730 closeClick : false, 731 width : 300, 732 height : 535, 733 type: 'iframe', 734 autoSize : false 735 }); 736 $('.fancybox-mobile-app-choice-two').fancybox({ 737 openEffect : 'elastic', 738 openSpeed : 150, 739 closeEffect : 'elastic', 740 closeSpeed : 150, 741 closeClick : false, 742 width : 300, 743 height : 430, 744 type: 'iframe', 745 autoSize : false 746 }); 747 748 749 $('a.fancybox-page').fancybox({ 750 openEffect : 'elastic', 751 openSpeed : 150, 752 closeEffect : 'elastic', 753 closeSpeed : 150, 754 closeClick : false, 755 fitToView: true, // 756 maxWidth: "95%", // 757 type: 'iframe', 758 autoSize : true, 759 }); 760 761 762 $('.fancybox-mobile-small').fancybox({ 763 openEffect : 'elastic', 764 openSpeed : 150, 765 closeEffect : 'elastic', 766 closeSpeed : 150, 767 closeClick : false, 768 width : 300, 769 height : 372, 770 type: 'iframe', 771 autoSize : false 772 // 7/4/2018 commented out by Ron so that entered values stay there, even when opening and closing the form 773 //autoSize : false, 774 //afterClose: function() { 775 // clearFormOnClose(); 776 //} 777 }); 778 779 $('.fancybox-counselor').fancybox({ 780 openEffect : 'elastic', 781 openSpeed : 150, 782 closeEffect : 'elastic', 783 closeSpeed : 150, 784 closeClick : false, 785 width : 350, 786 height : 250, 787 type: 'iframe', 788 autoSize : false 789 }); 790 /* 791 Fancybox -- Photos 792 */ 793 794 $('.fancybox').fancybox({ 795 openEffect : 'elastic', 796 openSpeed : 150, 797 closeEffect : 'elastic', 798 closeSpeed : 150, 799 closeClick : true, 800 maxWidth : 800, 801 maxHeight : 800 802 }); 803 804 /* 805 Fancybox -- Content 806 */ 807 808 $('.fancybox-content').fancybox({ 809 openEffect : 'elastic', 810 openSpeed : 150, 811 closeEffect : 'elastic', 812 closeSpeed : 150, 813 closeClick : false, 814 maxWidth : 800, 815 maxHeight : 800 816 }); 817 818 /* 819 Fancybox -- Contact 820 */ 821 $('.fancybox-contact-mobile').fancybox({ 822 openEffect : 'elastic', 823 openSpeed : 150, 824 closeEffect : 'elastic', 825 closeSpeed : 150, 826 closeClick : false, 827 width : 290, 828 height : 480, 829 fitToView: true, 830 autoSize : false 831 }); 832 833 $('.fancybox-contact').fancybox({ 834 openEffect : 'elastic', 835 openSpeed : 150, 836 closeEffect : 'elastic', 837 closeSpeed : 150, 838 closeClick : false, 839 width : 310, 840 height : 460, 841 autoSize : false 842 // 7/4/2018 commented out by Ron so that entered values stay there, even when opening and closing the form 843 //autoSize : false, 844 //afterClose: function() { 845 // clearFormOnClose(); 846 //} 847 }); 848 // Slate contact us form 849 $('.fancybox-contact-slate').fancybox({ 850 openEffect : 'elastic', 851 openSpeed : 150, 852 closeEffect : 'elastic', 853 closeSpeed : 150, 854 closeClick : false, 855 width : 280, 856 height : 480, 857 autoSize : false 858 // 7/4/2018 commented out by Ron so that entered values stay there, even when opening and closing the form 859 //autoSize : false, 860 //afterClose: function() { 861 // clearFormOnClose(); 862 //} 863 }); 864 /* 865 Fancybox -- HTML Files 866 */ 867 868 $("a.fancybox-referral").fancybox({ 869 'zoomSpeedIn' : 500, 870 'zoomSpeedOut' : 500, 871 'overlayShow' : false, 872 'padding' : 0, 873 'opacity' : 0.5, 874 fitToView: true, // 875 maxWidth : 600, 876 maxHeight : 650, 877 type: 'iframe', 878 autoSize : true, 879 'loop' : false 880 }); 881 882 883 /* 884 Fancybox -- Accredited 885 */ 886 887 $("a.fancybox-accredited").fancybox({ 888 'zoomSpeedIn' : 500, 889 'zoomSpeedOut' : 500, 890 'overlayShow' : false, 891 'padding' : 0, 892 'opacity' : 0.5, 893 fitToView: true, // 894 type: 'iframe', 895 autoSize : true, 896 'loop' : false, 897 maxWidth : 166, 898 maxHeight : 183, 899 }); 900 901 // Slate contact us form 902 $('.fancybox-request-virtual-visit').fancybox({ 903 openEffect : 'elastic', 904 openSpeed : 150, 905 closeEffect : 'elastic', 906 closeSpeed : 150, 907 closeClick : false,
908 width : 300, 909 height : 480, 910 autoSize : false 911 }); 912 913 $('.fancybox-video-shorts').fancybox({ 914 openEffect : 'elastic', 915 openSpeed : 150, 916 closeEffect : 'elastic', 917 closeSpeed : 150, 918 closeClick : false, 919 maxWidth: "800", 920 fitToView: true, 921 Height: 800, 922 type: 'iframe', 923 aspectRatio: true, 924 autoSize : true, 925 'loop' : false, 926 'scrolling' : 'no', 927 'iframe' : {'scrolling': 'yes'} 928}); 929$('.laureat-commencement-speech').fancybox({ 930 openEffect : 'elastic', 931 openSpeed : 150, 932 closeEffect : 'elastic', 933 closeSpeed : 150, 934 closeClick : false, 935 maxWidth: "800", 936 fitToView: true, 937 Height: 800, 938 type: 'iframe', 939 aspectRatio: true, 940 autoSize : true, 941 'loop' : false, 942 'scrolling' : 'no', 943 'iframe': { 'scrolling': 'yes' }, 944 afterClose: function() { 945 setCookie("visitorCommencement", "Guest", 30); 946 } 947 }); 948 949 950 $('.laureat-commencement-speech-mob').fancybox({ 951 openEffect : 'elastic', 952 openSpeed : 150, 953 closeEffect : 'elastic', 954 closeSpeed : 150, 955 closeClick : false, 956 width : 350, 957 height : 260, 958 type: 'iframe', 959 autoSize : false, 960 afterClose: function() { 961 setCookie("visitorCommencement", "Guest", 30); 962 } 963 }); 964 965 /* 966 Bevan Home Grid 967 */ 968 // hide all to start 969 $('#home-4-col .description').hide(); 970 971 // Open first FAQ on page load 972 $first = $('#home-4-col a.item').first(); 973 $content = $('#home-4-col .description').first(); 974 $content.slideToggle(200); 975 $first.addClass('active'); 976 977 978 $('#home-4-col a.item').click(function() { 979 var id = $(this).attr('href'); 980 981 $('#home-4-col .description').not('#' + id).slideUp(200); 982 $('#home-4-col #' + id).slideDown(200); 983 $('#home-4-col a.item').not(this).removeClass('active'); 984 $(this).addClass('active'); 985 return false; 986 }); 987 988 989 // Remove chrome autocomplete styling 990 $('input[autocomplete]').removeAttr('autocomplete'); 991 $("input").attr('autocomplete','off'); 992 993 // Remove top margin on first H2 on page 994 //$("article h2:first-of-type").addClass("margin-top-none"); 995 996 997 // Image Popup 998 999 $("#image-popup-accredited").click(function() { 1000 $.fancybox({ 1001 'padding' : 0, 1002 'href' : 'https://www.mum.edu/wp-content/uploads/sites/2/2016/07/HLC-logo-big.jpg', 1003 'transitionIn' : 'elastic', 1004 'transitionOut' : 'elastic' 1005 }); 1006 }); 1007 1008 // Image Popup 1009 1010 $("#video-carrey").click(function() { 1011 $.fancybox({ 1012 'padding' : 0, 1013 'href' : 'https://www.mum.edu/wp-content/themes/MUM/media/videos/carrey.html', 1014 'transitionIn' : 'elastic', 1015 'transitionOut' : 'elastic' 1016 }); 1017 }); 1018 1019 $("#program-link").click(function() { 1020 $('html, body').animate({ 1021 scrollTop: $("#academics").offset().top 1022 }, 1500); 1023 }); 1024 1025 1026 1027 // On page load 1028 1029 if (screenWidth > 1023) { 1030 setSubnavDesktop(); 1031 setLinksDesktop(); 1032 } else { 1033 setSubnavMobile(); 1034 setLinksMobile(); 1035 } 1036 getTopOffset(); 1037 equalHeight(); 1038 //console.log("In init.js: Just before calling selectStyling, not in a function, near bottom of file."); 1039 selectStyling(); 1040 //console.log("In init.js: Just after calling selectStyling, not in a function, near bottom of file."); 1041 sharePosition(); 1042 openActiveParent(); 1043 if ($.fn.buttonset) { 1044 $( ".citizen" ).buttonset(); 1045 } 1046 1047 // remove empty paragraphs within post content 1048 $('article p').each(function() { 1049 var $this = $(this); 1050 if($this.html().replace(/\s| /g, '').length === 0) 1051 $this.remove(); 1052 }); 1053}); 1054 1055function setCurrentTabCont(programName){ 1056 window.programName = programName; 1057} 1058function getPrevTabCont(){ 1059 return window.programName; 1060} 1061function setCurrentlocation(locationName){ 1062 window.locationName= locationName; 1063} 1064function getPrevlocation(){ 1065 return window.locationName; 1066} 1067setCurrentTabCont("All-undergrad-grad"); 1068setCurrentlocation("All-online-oncampus"); 1069 1070function openProgram(evt, programName) { 1071 if(programName === "all-undergrad" || programName === "all-grad" || programName === "All-undergrad-grad"){ 1072 setCurrentTabCont(programName); 1073 } 1074 if(programName === "Online" || programName === "On-campus" || programName === "All-online-oncampus"){ 1075 setCurrentlocation(programName); 1076 } 1077
1078 var prevTabCont = getPrevTabCont(); 1079 var prevlocationName = getPrevlocation(); 1080 //console.log("program",prevTabCont ); 1081 //console.log("Location ",prevlocationName); 1082 1083 if(prevTabCont === "all-undergrad" && programName === "Online"){ 1084 document.getElementById("undergrad-online-button").click(); 1085 document.getElementById("all-undergrad-button").classList.add("active"); 1086 document.getElementById("Online-button").classList.add("active"); 1087 return; 1088 } 1089 if(prevTabCont === "all-undergrad" && programName === "On-campus"){ 1090 document.getElementById("undergrad-oncampus-button").click(); 1091 document.getElementById("all-undergrad-button").classList.add("active"); 1092 document.getElementById("On-campus-button").classList.add("active"); 1093 return; 1094 } 1095 1096 1097 if(prevTabCont === "all-grad" && programName === "Online"){ 1098 document.getElementById("grad-online-button").click(); 1099 document.getElementById("all-grad-button").classList.add("active"); 1100 document.getElementById("Online-button").classList.add("active"); 1101 return; 1102} 1103 if(prevTabCont === "all-grad" && programName === "On-campus"){ 1104 document.getElementById("grad-oncampus-button").click(); 1105 document.getElementById("all-grad-button").classList.add("active"); 1106 document.getElementById("On-campus-button").classList.add("active"); 1107 return; 1108} 1109if(prevTabCont === "all-grad" && programName === "All-online-oncampus" ){ 1110 document.getElementById("all-grad-button").click(); 1111 document.getElementById("all-button1").classList.add("active"); 1112 document.getElementById("all-grad-button").classList.add("active"); 1113 return; 1114} 1115 // Declare all variables 1116 var i, tabcontent, tablinks; 1117console.log("clicked",evt); 1118 // Get all elements with class="tabcontent" and hide them 1119 tabcontent = document.getElementsByClassName("tabcontent"); 1120 for (i = 0; i < tabcontent.length; i++) { 1121 tabcontent[i].style.display = "none"; 1122 } 1123 1124 // Get all elements with class="tablinks" and remove the class "active" 1125 tablinks = document.getElementsByClassName("tablinks"); 1126 for (i = 0; i < tablinks.length; i++) { 1127 tablinks[i].className = tablinks[i].className.replace(" active", ""); 1128 } 1129 1130 // Show the current tab, and add an "active" class to the button that opened the tab 1131 document.getElementById(programName).style.display = "block"; 1132 evt.currentTarget.className += " active"; 1133 1134 if(prevlocationName === "All-online-oncampus" && programName === "All-undergrad-grad"){ 1135 document.getElementById("all-button").click(); 1136 document.getElementById("all-button1").classList.add("active"); 1137 document.getElementById("all-button").classList.add("active"); 1138 1139 } 1140 if(prevlocationName === "All-online-oncampus" && programName === "all-undergrad"){ 1141 document.getElementById("all-undergrad-button").click(); 1142 document.getElementById("all-button1").classList.add("active"); 1143 document.getElementById("all-undergrad-button").classList.add("active"); 1144 } 1145 if(prevlocationName === "All-online-oncampus" && programName === "all-grad"){ 1146 document.getElementById("all-grad-button").click(); 1147 document.getElementById("all-button1").classList.add("active"); 1148 document.getElementById("all-grad-button").classList.add("active"); 1149 } 1150 1151 1152 if(prevlocationName === "Online" && programName === "all-undergrad"){ 1153 document.getElementById("undergrad-online-button").click(); 1154 document.getElementById("all-undergrad-button").classList.add("active"); 1155 document.getElementById("Online-button").classList.add("active"); 1156 return; 1157 } 1158 if(prevlocationName === "Online" && programName === "all-grad"){ 1159 document.getElementById("grad-online-button").click(); 1160 document.getElementById("all-grad-button").classList.add("active"); 1161 document.getElementById("Online-button").classList.add("active"); 1162 } 1163 if(prevlocationName === "Online" && programName === "All-undergrad-grad"){ 1164 document.getElementById("Online-button").click(); 1165 document.getElementById("all-button").classList.add("active"); 1166 document.getElementById("Online-button").classList.add("active"); 1167 } 1168 1169 1170 if(prevlocationName === "On-campus" && programName === "All-undergrad-grad"){ 1171 document.getElementById("On-campus-button").click(); 1172 document.getElementById("all-button").classList.add("active"); 1173 document.getElementById("On-campus-button").classList.add("active"); 1174 } 1175 1176 if(prevlocationName === "On-campus" && programName === "all-undergrad"){ 1177 document.getElementById("undergrad-oncampus-button").click(); 1178 document.getElementById("all-undergrad-button").classList.add("active"); 1179 document.getElementById("On-campus-button").classList.add("active"); 1180 } 1181 if(prevlocationName === "On-campus" && programName === "all-grad"){ 1182 document.getElementById("grad-oncampus-button").click(); 1183 document.getElementById("all-grad-button").classList.add("active"); 1184 document.getElementById("On-campus-button").classList.add("active"); 1185 } 1186 1187 1188 1189 if(prevTabCont === "all-undergrad" && programName === "All-online-oncampus" ){ 1190 document.getElementById("all-undergrad-button").click(); 1191 document.getElementById("all-button1").classList.add("active"); 1192 document.getElementById("all-undergrad-button").classList.add("active"); 1193 return; 1194 } 1195 if(prevTabCont === "All-undergrad-grad" && programName === "All-online-oncampus" ){ 1196 document.getElementById("all-button1").click(); 1197 document.getElementById("all-button").classList.add("active"); 1198 document.getElementById("all-button1").classList.add("active"); 1199 return; 1200 } 1201 if(prevTabCont === "All-undergrad-grad" && programName === "Online" ){ 1202 document.getElementById("Online-button").click(); 1203 document.getElementById("all-button").classList.add("active"); 1204 document.getElementById("Online-button").classList.add("active"); 1205 return; 1206 } 1207 if(prevTabCont === "All-undergrad-grad" && programName === "On-campus" ){ 1208 document.getElementById("On-campus-button").click(); 1209 document.getElementById("all-button").classList.add("active"); 1210 document.getElementById("On-campus-button").classList.add("active"); 1211 return; 1212 } 1213 1214} 1215window.addEventListener("load", function () { 1216 const dropdownItems = document.querySelectorAll(".dropdown .drop-down"); 1217
1218 dropdownItems.forEach(function (item, index) { 1219 const button = item.querySelector(".toggle"); 1220 const panel = item.querySelector(".toggle-box"); 1221 1222 if (!button || !panel) { 1223 return; 1224 } 1225 1226 const uniqueId = `toggle-ques-${index + 1}`; 1227 1228 // Remove the existing hard-coded IDs 1229 button.removeAttribute("id"); 1230 panel.removeAttribute("id"); 1231 1232 // Generate new unique IDs 1233 const buttonId = `${uniqueId}-button`; 1234 const panelId = `${uniqueId}-panel`; 1235 1236 button.id = buttonId; 1237 panel.id = panelId; 1238 1239 // Add accessibility relationships 1240 button.setAttribute("type", "button"); 1241 button.setAttribute("aria-controls", panelId); 1242 1243 // Keep the current expanded state if it already exists 1244 if (!button.hasAttribute("aria-expanded")) { 1245 button.setAttribute("aria-expanded", "false"); 1246 } 1247 1248 panel.setAttribute("role", "region"); 1249 panel.setAttribute("aria-labelledby", buttonId); 1250 }); 1251 //satisfying accessibility issue 1252 function labelRecaptcha() { 1253 const textarea = document.querySelector( 1254 'textarea[name="g-recaptcha-response"]' 1255 ); 1256 1257 if (!textarea) { 1258 setTimeout(labelRecaptcha, 500); 1259 return; 1260 } 1261 1262 const id = textarea.id || "g-recaptcha-response"; 1263 1264 if (!textarea.id) { 1265 textarea.id = id; 1266 } 1267 1268 if (!document.querySelector(`label[for="${id}"]`)) { 1269 const label = document.createElement("label"); 1270 label.htmlFor = id; 1271 label.textContent = "Google reCAPTCHA response"; 1272 1273 Object.assign(label.style, { 1274 position: "absolute", 1275 width: "1px", 1276 height: "1px", 1277 margin: "-1px", 1278 padding: "0", 1279 overflow: "hidden", 1280 clip: "rect(0,0,0,0)", 1281 clipPath: "inset(50%)", 1282 whiteSpace: "nowrap", 1283 border: "0" 1284 }); 1285 1286 textarea.parentNode.insertBefore(label, textarea); 1287 } 1288 } 1289 1290 labelRecaptcha(); 1291});
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.