(function ($) { Drupal.behaviors.qconbs = { attach: function (context, settings) { "use strict"; window.addEventListener('scroll', function(e){ var distanceY = window.pageYOffset || document.documentElement.scrollTop, shrinkOn = 200, // How many pixels does the window have to scroll before the header shrinks header = $(".qcon-base-top"); if (distanceY > shrinkOn) { header.addClass("smaller"); } else { if (header.hasClass("smaller")) { header.removeClass("smaller"); } } }); $('#topLeftSlider').once('topLeftSliderProcessed', function () { $('#topLeftSlider').carousel({interval: 3000}); $('#topLeftSlider .slide2').on('click tap', function(e) { //w3c: e.preventDefault(); e.stopPropagation(); //IE: e.returnValue = false; e.cancelBubble = true; window.location.href = $(this).data('destination'); }); $('#topLeftSlider .slide3').on('click tap', function(e) { //w3c: e.preventDefault(); e.stopPropagation(); //IE: e.returnValue = false; e.cancelBubble = true; $('html, body').animate({ scrollTop: $($(this).data('destination')).offset().top - $('.qcon-base-top').innerHeight() + 40 }, 3000); }); }); //initialize eqHegth $('.past-years-flex-align').eqHeight('.panel'); $('#views-bootstrap-carousel-1').on('slide.bs.carousel', function () { $(window).resize(); }) $('#comments-collapse').click(function(e) { $('#comments-content-wrapper').toggle('slow'); $(this).text() == 'Expand' ? $(this).text('Collapse') : $(this).text('Expand'); }); var config = { duration: 800, origin: 'bottom', viewFactor: 0.25, distance: "50px", scale: "1,0.85", } if(typeof ScrollReveal !== 'undefined' && window.location.hash == ''){ if(typeof window.sr === 'undefined'){ window.sr = ScrollReveal(config); } sr.reveal('.qcon-sr-home'); sr.reveal('.qcon-sr-home.delay0',{delay: 200}); sr.reveal('.qcon-sr-home.delay1',{delay: 400}); sr.reveal('.qcon-sr-home.delay2',{delay: 600}); } $('.phv[data-video]').click(function(e){ var $video = $('