'; jQuery('body').prepend(notificationMarkUp); var $videoToggle = jQuery('[data-video-toggle]'); var $videoWrapper = jQuery('[data-video]'); $videoToggle.on('click', function() { jQuery(this).addClass('active'); $videoToggle.not(jQuery(this)).removeClass('active'); var target = jQuery(this).attr('data-video-toggle'); $videoWrapper.not(`[data-video='${target}']`).hide(); jQuery('#student-stories').find(`[data-video='${target}']`).show(); }) // Cycle through leadspace images var $imgs = jQuery('.hero-img'); var current = 0; var nextImage = function() { if (current >= $imgs.length) current = 0; $imgs.eq(current++).fadeIn(function() { jQuery(this).delay(3000).fadeOut(nextImage); }) }; nextImage(); var $accordion_heading = jQuery('button.bx--accordion__heading'); $accordion_heading.on('click', function() { var $parent = jQuery(this).parent() var $siblings = $accordion_heading.parent().not($parent) if ($parent.hasClass('bx--accordion__item--active')) { $parent.removeClass('bx--accordion__item--active') $parent.attr("aria-expanded", "false"); $parent.addClass('bx--accordion__item--collapsing'); setTimeout(function() { $parent.removeClass('bx--accordion__item--collapsing'); }, 110); } else { $parent.addClass('bx--accordion__item--active') $parent.attr("aria-expanded", "true"); $parent.addClass('bx--accordion__item--expanding'); setTimeout(function() { $parent.removeClass('bx--accordion__item--expanding'); }, 110); } }) } )