(function ($) { $(document).ready(function() { $(window).scroll(function() { if (1 < $(this).scrollTop()) { $('header').addClass('sticky'); } else { $('header').removeClass('sticky'); } }); $('.magnify_icon').click(function() { if ($(this).hasClass('active')) { $(this).removeClass('active'); $('.search_box').hide(); } else { $(this).addClass('active'); $('.search_box').show(); } }); $('.search_box .close').click(function() { $('.magnify_icon').removeClass('active'); $('.search_box').hide(); }); }); })(jQuery);// (function ($) { // $(document).ready(function() { // function mobilemenuButton() { $('.mobile_menu').on('click', function(e) { $('.primary_menu').slideToggle(); if ($(this).hasClass('open')) { $(this).removeClass('open'); } else { $(this).addClass('open'); } }); } // function mobileMenu() { $('.menu li.menu-item-has-children').on('click', function(e) { if ($(this).hasClass('on_active')) { $(this).removeClass('on_active'); $(this).children('.sub-menu').slideUp(); } else { $(this).addClass('on_active'); $(this).children('.sub-menu').slideDown(); } }).on('click', '.sub-menu', function(e) { e.stopPropagation(); }); } mobilemenuButton(); mobileMenu (); }); })(jQuery); (function ($) { $(document).ready(function() { function homepageHero() { if ($('#slide-counter').length) { const speedTransitions = 700; $('#slide-counter').prepend(''); const slider = $('.bxslider').bxSlider({ auto: true, pagerCustom: '#bxpager', controls: true, mode: 'vertical', speed: speedTransitions, touchEnabled: false, onSliderLoad: function(currentIndex) { $('.home_hero_content').find('.bx-viewport').find('ul').children().eq(currentIndex).addClass('active-slide'); newcurrentIndex = currentIndex + 1; let stringIndex = newcurrentIndex.toString(); stringIndex = '0' + stringIndex; $('#slide-counter .current-index').text(stringIndex); }, onSlideBefore: function($slideElement, oldIndex, newIndex) { $('.home_hero_content').find('.bx-viewport').find('ul').children().removeClass('active-slide'); $slideElement.addClass('active-slide'); totalSlides = slider.getSlideCount()-1; newnewIndex = newIndex + 1; let stringIndex1 = 0; if (newnewIndex > totalSlides) { newnewIndex = 0; stringIndex1 = (totalSlides+1).toString(); stringIndex1 = '0' + stringIndex1; } else { stringIndex1 = newnewIndex.toString(); stringIndex1 = '0' + stringIndex1; } $('#slide-counter .current-index').text(stringIndex1); thumbnailSlider.goToSlide(newnewIndex); } }); $('#slide-counter').append('' + '0' + slider.getSlideCount() + ''); $('ul.bxslider2 li').each(function(item) { $(this).find('.overlay-loading').css('width', 0); }); const thumbnailSlider = $('#bxpager').bxSlider({ //auto: true, mode: 'horizontal', slideWidth: 220, startSlide: 1, controls: false, speed: speedTransitions, infiniteLoop: true, touchEnabled: false, onSliderLoad: function(currentIndex) { $('ul.bxslider2 li .overlay-loading').css('width', '100%'); }, onSlideAfter: function(slideElement, oldIndex, newIndex) { let speedTimeLapse = (speedTransitions - 150) / 100 * 1000; //thumbnailSlider.stopAuto(); //thumbnailSlider.startAuto(); slideElement.find('.overlay-loading').css({ 'width': 0, 'transition': 'none' }); slideElement.find('.overlay-loading').animate({ width: '100%' }, speedTimeLapse); } }); $('#gonext').click(function() { slider.goToNextSlide(); slider.stopAuto(); slider.startAuto(); return false; }); $('#goprev').click(function() { slider.goToPrevSlide(); slider.stopAuto(); slider.startAuto(); return false; }); } } homepageHero(); }); })(jQuery); (function ($) { $(document).ready(function() { function homeTicker() { $('.newsticker').bxSlider({ auto: true, speed: 1500, pause: 6000, mode: 'horizontal', controls: false, pager: false, touchEnabled: false, }); } homeTicker(); }); })(jQuery); (function ($) { var homeSponsorsSlider; $(document).ready(function() { homeSponsorsSlider = $('#home-sponsors-bxslider').bxSlider({ slideWidth: 200, minSlides: 3, maxSlides: 5, slideMargin: 10, //auto: true, speed: 1000, autoControls: true, touchEnabled: false, }); $( "#home-sponsors-bxslider-next" ).click(function(e) { e.preventDefault(); homeSponsorsSlider.goToNextSlide(); }); }); })(jQuery); (function ($) { $(document).ready(function() { $(document.body).on('click', '.js-item-tag, .js-items-get-more', function(e) { e.preventDefault(); const $el = $(this); const filterData = { type: $el.attr('data-type'), tag: $el.attr('data-tag'), offset: ($el.attr('data-offset')) ? $el.attr('data-offset') : 0 }; const $items = $('.js-items-container'); const postType = $items.attr('data-type'); const postTax = $items.attr('data-tax'); const $loadMore = $('.js-load-more'); const $loadMoreLink = $loadMore.find('a'); filterData.action = 'bsa_get_more_items'; /* eslint-disable-next-line camelcase */ filterData.post_type = postType; filterData.tax = postTax; if ($el.hasClass('js-item-tag')) { if ($el.hasClass('filter-item-active')) { console.log('1'); $el.removeClass('filter-item-active'); $el.parent().removeClass('filter-item-active'); $('#associate_navigation_inner .slick-slide.slick-current .associate_navigation_item').addClass('filter-item-active'); $('#associate_navigation_inner .slick-slide.slick-current .associate_navigation_item a').addClass('filter-item-active'); filterData.tag = 'all'; } else if (! $el.hasClass('filter-item-active')) { console.log('2'); $('.js-item-tag.filter-item-active').parent().removeClass('filter-item-active'); $('.js-item-tag.filter-item-active').removeClass('filter-item-active'); $el.closest('ul').find('li').removeClass('filter-item-active'); $el.addClass('filter-item-active'); $el.parent().addClass('filter-item-active'); } } $.ajax({ url: bsatheme.ajax_url, data: filterData, type: 'post', dataType: 'json', beforeSend: function() { $loadMore.find('a span:first-of-type').text(bsatheme.loading_more); $loadMore.addClass('loading-elem'); }, success: function(r) { try { $loadMore.find('a span:first-of-type').text(bsatheme.load_more); $loadMoreLink.attr('data-tag', r.data.tag); $loadMoreLink.attr('data-offset', r.data.offset); $loadMore.removeClass('loading-elem'); if (r.success && r.data.items) { if ('load' === filterData.type) { $items.append(r.data.items); if (r.data.offset) { $loadMore.show(); } else { $loadMore.hide(); } } else if ('filter' === filterData.type) { $items.empty().append(r.data.items); if (r.data.offset) { $loadMore.show(); } else { $loadMore.hide(); } } } else { if ('load' === filterData.type) { $loadMore.hide(); } else if ('filter' === filterData.type) { $items.empty().append('

' + bsatheme.no_items + '

'); $loadMore.hide(); } } } catch (e) { console.error(e); } }, error: function() { console.log('Something went wrong.'); } }); }); }); })(jQuery); (function ($) { $(document).ready(function() { function upcomingEvents() { let upcomingEventsItem = 0; $('ul.upcoming_events li').each(function(data) { upcomingEventsItem++; }); const upcomingEvents = $('.upcoming_events').bxSlider({ auto: false, mode: 'horizontal', controls: false, pagerCustom: '#eventpager', touchEnabled: false, onSlideBefore: function($slideElement, oldIndex, newIndex) { $('.event_number span').empty(); $('.event_number span').text('0' + (newIndex+1)); } }); $('#event_next').click(function() { upcomingEvents.goToNextSlide(); return false; }); $('#event_prev').click(function() { upcomingEvents.goToPrevSlide(); return false; }); } upcomingEvents(); }); })(jQuery); (function ($) { $(document).ready(function() { function memberSlider() { if ($('#member_nav').length) { const slides = $('.slide_member').bxSlider({ auto: true, speed: 1000, pause: 4000, mode: 'horizontal', controls: true, pager: false, touchEnabled: false, }); $('#nextmember').click(function() { slides.goToNextSlide(); return false; }); $('#prevmember').click(function() { slides.goToPrevSlide(); return false; }); } } memberSlider(); }); })(jQuery); (function ($) { $(document).ready(function() { function backTop() { $('.back_to_top').click(function() { $('html, body').animate({ scrollTop: 0 }, 'slow'); return false; }); } backTop(); }); })(jQuery); (function ($) { $(document).ready(function() { if ($('.subheader').length) { const length = 99; window.onscroll = function(ev) { let sectionElement = []; let sectionPosition = []; let menustatus = []; for (let x = 1; x <= length; x++) { sectionElement[x] = $('#section' + x); if (sectionElement[x].length) { sectionPosition[x] = sectionElement[x].offset().top - $(window).scrollTop(); } menustatus[x] = $('.section' + x); if (100 < sectionPosition[x]) { menustatus[x].removeClass('active'); menustatus[x].removeClass('endOfEach'); } else { menustatus[x].addClass('active'); } } }; $('.subheader ul li').on('click', function(e) { $('.subheader ul li').removeClass('active'); $('.subheader ul li').removeClass('endOfEach'); $(this).addClass('endOfEach'); let parent = $(this).parents('ul'); parent.find('li').removeClass('active'); parent.find('li').each(function(index) { if ($(this).hasClass('endOfEach')) { return false; } $(this).addClass('active'); }); }); for (let x = 1; x <= length; x++) { $('.section' + x + ' ' + 'a').click(function(e) { e.preventDefault(); $('html,body').animate({ scrollTop: $('#section' + x).offset().top - 120 }, 1000); }); } } }); })(jQuery);(function ($) { $(document).ready(function() { if ($('#video').length) { const video = document.querySelector('#video'), button = document.querySelector('#play'), button2 = document.querySelector('#watchnow'); button.addEventListener('click', function() { video.play(); $('#play').fadeOut(); $('.watch_now').fadeOut(); }, false); video.addEventListener('click', function() { video.pause(); $('#play').fadeIn(); $('.watch_now').fadeIn(); }, false); button2.addEventListener('click', function() { video.play(); $('#play').fadeOut(); $('.watch_now').fadeOut(); }, false); button2.addEventListener('click', function() { video.pause(); $('#play').fadeIn(); $('.watch_now').fadeIn(); }, false); } }); })(jQuery); (function ($) { $(document).ready(function() { // Initiate Promo Highlights Slider Slider Slick $('#associate_navigation_inner').on('init', function(even, slick) { $('#associate_navigation_inner .slick-slide.slick-current .associate_navigation_item').addClass('filter-item-active'); $('#associate_navigation_inner .slick-slide.slick-current .associate_navigation_item a').addClass('filter-item-active'); }).slick({ centerMode: false, autoplaySpeed: 5000, dots: false, arrows: true, infinite: true, speed: 500, mobileFirst: true, variableWidth: true, adaptiveHeight: false, }) .on('beforeChange', function(event, slick, currentSlide, nextSlide) { }); // On Click of Nav Button, Switch Slide $('#arrow_bottom_small').on('click', (function(e) { e.preventDefault(); $('#associate_navigation_inner').slick( 'slickNext' ); })); }); })(jQuery); (function ($) { $(document).ready(function() { function bigOurPeopleAlideshow() { // Initiate Promo Highlights Slider Slider Slick $('.our_people_content_slideshow').on('init', function(even, slick) { }).slick({ centerMode: false, autoplaySpeed: 5000, dots: false, arrows: true, infinite: false, speed: 500, mobileFirst: true, variableWidth: true, adaptiveHeight: false, rows: 2, slidesToShow: 2, slidesToScroll: 2, prevArrow:"", nextArrow:"", responsive: [ { breakpoint: 700, settings: { slidesToShow: 3, slidesToScroll: 3, } }, { breakpoint: 900, settings: { slidesToShow: 3, slidesToScroll: 3, } }, { breakpoint: 1100, settings: { slidesToShow: 4, slidesToScroll: 4, } }, { breakpoint: 1300, settings: { slidesToShow: 5, slidesToScroll: 5, } }, { breakpoint: 1500, settings: { slidesToShow: 6, slidesToScroll: 6, } }, { breakpoint: 1700, settings: { slidesToShow: 7, slidesToScroll: 7, } }, { breakpoint: 1900, settings: { slidesToShow: 8, slidesToScroll: 8, } } ] }) .on('beforeChange', function(event, slick, currentSlide, nextSlide) { }); } function peopleNavigation() { // Initiate Promo Highlights Slider Slider Slick $('#navigation_slides').on('init', function(even, slick) { }).slick({ centerMode: false, autoplaySpeed: 5000, dots: false, arrows: false, infinite: true, speed: 500, mobileFirst: true, variableWidth: true, adaptiveHeight: false, }) .on('beforeChange', function(event, slick, currentSlide, nextSlide) { }); // On Click of Nav Button, Switch Slide $('.our_people_navigation .next_arrow').on('click', (function(e) { e.preventDefault(); $('#navigation_slides').slick( 'slickNext' ); })); } function peopleReload() { $('.our_people_navigation ul li a').click(function(e) { e.preventDefault(); $('.our_people_navigation ul li').removeClass('current'); $('.our_people_navigation ul li a').removeClass('current'); $(this).parents('li').addClass('current'); $(this).addClass('current'); let nav = $(this).attr('data-index'); $('.our_people_content').each(function(index) { let contentdata = $(this).attr('data-index'); if (contentdata == nav) { //$('.our_people_content').animate({opacity: '0', visibility: 'hidden'}); $('.our_people_content').removeClass('current'); //$(this).animate({opacity: '1'}); $(this).addClass('current'); } }); }); } peopleNavigation(); peopleReload(); bigOurPeopleAlideshow(); }); })(jQuery); (function ($) { $(document).ready(function() { $('.play').click(function(e) { e.preventDefault(); playAudio($(this).closest('.podcast_video')); }); $('.pause').click(function(e) { e.preventDefault(); pauseAudio($(this).closest('.podcast_video')); }); $('.listen_now').click(function(e) { e.preventDefault(); playAudio($(this).closest('.podcast_description').siblings('.podcast_video')); }); }); function playAudio(podcast_video_elem) { pauseAll(); $(podcast_video_elem).find('.audio_player').trigger('play'); $(podcast_video_elem).find('.play').hide(); $(podcast_video_elem).find('.pause').show(); } function pauseAudio(podcast_video_elem) { $(podcast_video_elem).find('.audio_player').trigger('pause'); $(podcast_video_elem).find('.play').show(); $(podcast_video_elem).find('.pause').hide(); } function pauseAll() { $('.podcast_video').each(function( index ) { pauseAudio($(this)); }); } })(jQuery); (function ($) { $(document).ready(function() { function videoSlides() { if ($('#videoslider').length) { let videoItem = 0; $('.videoslider li').each(function(data) { videoItem++; }); const videoSliders = $('.videoslider').bxSlider({ auto: false, mode: 'vertical', pagerCustom: '#bxpager', controls: false, pagerCustom: '#video_slides_navigation', touchEnabled: false }); const thumbnailSlider = $('#bxpager').bxSlider({ auto: false, mode: 'vertical', slideWidth: 780, startSlide: 0, controls: false, touchEnabled: false }); $('#gonext').click(function() { videoSliders.goToNextSlide(); thumbnailSlider.goToNextSlide(); let currentNumber = parseInt($('.slides_number .number').text()); $('.slides_number .number').empty(); $('.videosliders').trigger('pause'); if (currentNumber < videoItem) { currentNumber++; } else { currentNumber = 1; } $('.slides_number .number').text('0' + currentNumber); return false; }); $('#goprev').click(function() { videoSliders.goToPrevSlide(); thumbnailSlider.goToPrevSlide(); let currentNumber = parseInt($('.slides_number .number').text()); $('.slides_number .number').empty(); $('.videosliders').trigger('pause'); if (1 < currentNumber) { currentNumber--; } else { currentNumber = videoItem; } $('.slides_number .number').text('0' + currentNumber); return false; }); } } function playVideo() { if ($('#videoslider').length) { $('.play_button').click(function() { $(this).siblings('.videosliders').trigger('play'); $('.play_button').hide(); $('.watch_now').hide(); }); $('.videosliders').click(function() { $(this).trigger('pause'); $('.play_button').show(); $('.watch_now').show(); }); $('.watch_now').click(function(e) { e.preventDefault(); $(this).siblings('.videosliders').trigger('play'); $('.play_button').hide(); $('.watch_now').hide(); }); $('.slides_description .cta_default').click(function(e) { e.preventDefault(); slideindex = $(this).closest('li').data('slide-index'); $('.videoslider li[data-slide-index='+slideindex+']:not(.bx-clone)').find('.videosliders').trigger('play'); //$(this).siblings('.videosliders').trigger('play'); $('.play_button').hide(); $('.watch_now').hide(); }); } } videoSlides(); playVideo(); }); })(jQuery); (function ($) { $(document).ready(function() { //on html5 video click $( ".html5-video" ).not('a').click(function() { var htmlVideo = $( ".html5-video" ).find('video'); if ($(this).hasClass('playing')) { //is playing, must pause onclick $(this).removeClass('playing'); $(this).addClass('paused'); htmlVideo.get(0).pause(); } else if ($(this).hasClass('paused')) { //is paused, must play onclick $(this).removeClass('paused'); $(this).addClass('playing'); htmlVideo.get(0).play(); } else { //is stopped, must play onclick $(this).addClass('playing'); htmlVideo.get(0).currentTime = 0; htmlVideo.get(0).play(); } }); //on click html5 video with full screen option $( ".html5-video-overlay-btn" ).click(function() { var htmlVideoElem = $(this).closest('.html5-video-fullscreen'); var htmlVideo = htmlVideoElem.find('video'); if (htmlVideoElem.hasClass('playing')) { //is playing, must pause onclick htmlVideoElem.removeClass('playing'); htmlVideoElem.addClass('paused'); htmlVideo.get(0).pause(); } else if (htmlVideoElem.hasClass('paused')) { //is paused, must play onclick htmlVideoElem.removeClass('paused'); htmlVideoElem.addClass('playing'); htmlVideo.get(0).play(); } else { //is stopped, must play onclick htmlVideoElem.addClass('playing'); htmlVideo.get(0).currentTime = 0; htmlVideo.get(0).play(); } }); //on full screen clicked $( ".html5-video-fullscreen-btn" ).click(function() { var htmlVideoElem = $(this).closest('.html5-video-fullscreen'); var htmlVideo = htmlVideoElem.find('video'); var elem = htmlVideo.get(0); htmlVideoElem.removeClass('paused'); htmlVideoElem.addClass('playing'); elem.play(); if (elem.requestFullscreen) { elem.requestFullscreen(); } else if (elem.mozRequestFullScreen) { elem.mozRequestFullScreen(); } else if (elem.webkitRequestFullscreen) { elem.webkitRequestFullscreen(); } else if (elem.msRequestFullscreen) { elem.msRequestFullscreen(); } }); }); })(jQuery); (function ($) { $(document).ready(function() { function eventsoverviewSubhero() { if ($('#slides-counter').length) { const speedTransitions = 500; $('#slides-counter').prepend(''); const slider = $('.bxslider').bxSlider({ auto: true, pagerCustom: '#bxpager', controls: true, mode: 'vertical', speed: speedTransitions, touchEnabled: false, onSliderLoad: function(currentIndex) { $('.home_hero_content').find('.bx-viewport').find('ul').children().eq(currentIndex).addClass('active-slide'); newcurrentIndex = currentIndex + 1; let stringIndex = newcurrentIndex.toString(); stringIndex = '0' + stringIndex; $('#slides-counter .current-index').text(stringIndex); }, onSlideBefore: function($slideElement, oldIndex, newIndex) { $('.home_hero_content').find('.bx-viewport').find('ul').children().removeClass('active-slide'); $slideElement.addClass('active-slide'); totalSlides = slider.getSlideCount()-1; newnewIndex = newIndex + 1; let stringIndex1 = 0; if (newnewIndex > totalSlides) { newnewIndex = 0; stringIndex1 = (totalSlides+1).toString(); stringIndex1 = '0' + stringIndex1; } else { stringIndex1 = newnewIndex.toString(); stringIndex1 = '0' + stringIndex1; } $('#slides-counter .current-index').text(stringIndex1); thumbnailSlider.goToSlide(newnewIndex); } }); $('#slides-counter').append('' + '0' + slider.getSlideCount() + ''); $('ul.bxslider2 li').each(function(item) { $(this).find('.overlay-loading').css('width', 0); }); const thumbnailSlider = $('#bxpager').bxSlider({ //auto: true, mode: 'horizontal', slideWidth: 220, startSlide: 1, controls: false, speed: speedTransitions, infiniteLoop: true, touchEnabled: false, onSliderLoad: function(currentIndex) { $('ul.bxslider2 li .overlay-loading').css('width', '100%'); }, onSlideAfter: function(slideElement, oldIndex, newIndex) { let speedTimeLapse = (speedTransitions - 150) / 100 * 1000; //thumbnailSlider.stopAuto(); //thumbnailSlider.startAuto(); slideElement.find('.overlay-loading').css({ 'width': 0, 'transition': 'none' }); slideElement.find('.overlay-loading').animate({ width: '100%' }, speedTimeLapse); } }); $('#gonext').click(function() { slider.goToNextSlide(); slider.stopAuto(); slider.startAuto(); return false; }); $('#goprev').click(function() { slider.goToPrevSlide(); slider.stopAuto(); slider.startAuto(); return false; }); } } eventsoverviewSubhero(); }); })(jQuery);(function ($) { $(document).ready(function() { let elements = bsatheme.events; let today = Date.now(); $('.flatpickr').flatpickr({ inline: true, enable: elements, static: true, clickOpens: false, animate: true, ariaDateFormat: 'Y-m-d', onDayCreate: function(dObj, dStr, fp, dayElem) { let dateElem = dayElem.getAttribute('aria-label'); //console.log(dateElem); dayElem.innerHTML += ''; dayElem.setAttribute('data-id', dateElem); }, onChange: function(selectedDates, dateStr, instance) { let date = dateStr; const offset = $('[data-id=' + date + ']').offset(); $('html, body').animate({ scrollTop: offset.top - 150 }, 750); console.log(date); console.log(offset); } }); }); })(jQuery);(function ($) { $(document).ready(function() { function pastEvents() { if (1180 > window.innerWidth) { if ($('#pastevents').length) { let slides = $('.past_sliders').bxSlider({ auto: false, speed: 1000, pause: 4000, mode: 'horizontal', minSlides: 1, maxSlides: 1, moveSlides: 1, controls: true, slideWidth: 520, pager: false, touchEnabled: false, }); $('#nextevents').click(function() { slides.goToNextSlide(); return false; }); $('#prevevents').click(function() { slides.goToPrevSlide(); return false; }); } } else { if ($('#pastevents').length) { let slides = $('.past_sliders').bxSlider({ auto: false, speed: 1000, pause: 4000, mode: 'horizontal', minSlides: 2, maxSlides: 2, moveSlides: 1, controls: true, slideWidth: 520, pager: false, touchEnabled: false, }); $('#nextevents').click(function() { slides.goToNextSlide(); return false; }); $('#prevevents').click(function() { slides.goToPrevSlide(); return false; }); } } } pastEvents(); }); })(jQuery);