// mb 11-7-14 fix imageCycle height based on heighest image $(window).load(function(){ $('.imageCycle').each(function(){ var maxHeight = 0; $(this).find('img').each(function(){ var h = $(this).height(); if (h > maxHeight) { maxHeight = h; } }); if (maxHeight) { $(this).css({height:maxHeight}); } }); }); $(document).ready(function() { $( "#filterDossiers" ).keyup(function() { $("#dossiers a").hide(); $('#dossiers a[data-title*="'+$(this).val().toLowerCase()+'"]').show(); if($(this).val() == ""){ $("#dossiers a").show(); } }); if($("#carousel li").length == 1){ $("#carousel").css("height", "200px"); } if($("#carousel li").length == 2){ $("#carousel").css("height", "400px"); } //Filter partners $(".filter#partner").keyup(function() { //Create case-insensitive contains operator $.extend($.expr[":"], { "containsIN": function(elem, i, match, array) { return (elem.textContent || elem.innerText || "").toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0; } }); var $filter = $(this).val(); var $partners = $("section#lijstweergave.partners").find('ul li'); var $filterCorrespondingPartners = $("section#lijstweergave.partners").find('ul li a > h2:containsIN("' + $filter + '")'); if($filter == '') { $partners.show(); } else { $partners.hide(); $filterCorrespondingPartners.parent().parent().show(); } }); $(".banner").each(function(key, value){ banner = $(this).find("a"); var bannerTitle = $(banner).attr('data-title'); var bannerPos = $(banner).attr('data-position'); //console.log(bannerPos+"<>"+bannerTitle); //console.log(bannerPos+", "+bannerTitle); if(bannerTitle!= '' && bannerPos !=''){ _gaq.push(['_trackEvent', 'Banner view', bannerPos, bannerTitle]); } }); // send outbound banner click to GA $(".banner a").on('click',function(e){ var bannerTitle = $(this).attr('data-title'); var bannerPos = $(this).attr('data-position'); var bannerUrl = $(this).attr('href'); //console.log(bannerPos+", "+bannerUrl+", "+bannerTitle); _gaq.push(['_trackEvent', 'Banner click', bannerPos, bannerTitle]); }); var owl = $("#spotlights"); owl.owlCarousel({ items : 3, //10 items above 1000px browser width itemsDesktop : [1000,3], //5 items between 1000px and 901px itemsDesktopSmall : [850,2], // betweem 900px and 601px itemsTablet: [560,1], //2 items between 600 and 0 itemsMobile : false,// itemsMobile disabled - inherit from itemsTablet option navigation : true, autoPlay: true }); var owlRel = $("#related-cycle ul"); owlRel.owlCarousel({ items : 4, //10 items above 1000px browser width itemsDesktop : [940,3], //5 items between 1000px and 901px itemsDesktopSmall : [500,2], // betweem 900px and 601px itemsTablet: [380,1], //2 items between 600 and 0 itemsMobile : false, // itemsMobile disabled - inherit from itemsTablet option navigation : true }); $("#dossierSponsors").owlCarousel({ items : 4, //10 items above 1000px browser width itemsDesktop : [1150,3], //5 items between 1000px and 901px itemsDesktopSmall : [780, 4], // betweem 900px and 601px itemsTablet: [600, 3], //2 items between 600 and 0 itemsMobile : [450, 2],// itemsMobile disabled - inherit from itemsTablet option navigation : false, autoPlay: true, scrollPerPage: true }); $.shifter({ maxWidth:'Infinity' }); $.shifter("enable"); $("#mobileMenuButton a").click(function(e){ e.preventDefault(); if($(this).hasClass('active')){ $(this).removeClass('active'); $("#mobileSearch").hide(); }else{ $(this).addClass('active'); $("#mobileSearch").show(); } }); $("#mobileMenuButton .icon").click(function(){ if($(this).hasClass('active')){ $(this).removeClass('active'); //$.shifter("close"); //$.shifter("disable"); }else{ $(this).addClass('active'); //$.shifter("enable"); //$.shifter("open"); } }); $( '.imageCycle' ).cycle(); $( '#homeCycle' ).cycle(); $('#carousel').jcarousel({ vertical: true //start:-4 }); var start = 16; $(".next").click(function(){ //mycarousel_fadeOut(); type = $("#carousel").attr("data-type"); //check for older items to add $.ajax({ url:'/application-pages/370/videoitems.html?startId='+start+"&type="+type, }).always(function(data){ start+=5; if(data!=''){ $("#carousel ul").append(data); $('#carousel').jcarousel('reload', { animation: 'slow' }); } $('#carousel').jcarousel('scroll', '+=1'); }); }); $(".prev").click(function(){ $('#carousel').jcarousel('scroll', '-=1'); }); var cycle = null; document.body.style.overflow = "hidden"; var viewportWidth = $(window).width(); var viewportHeight = $(window).height(); document.body.style.overflow = ""; if(viewportWidth <=500 ){ if(cycle == null){ //console.log('add cycle'); cycle = $( 'aside' ).cycle({ timeout: 5000, slideExpr: $("aside>div").not(".no-cycle") }); } } $( window ).resize(function() { document.body.style.overflow = "hidden"; viewportWidth = $(window).width(); viewportHeight = $(window).height(); document.body.style.overflow = ""; if(viewportWidth <=500 ){ if(cycle == null){ //console.log('add cycle'); cycle = $( 'aside' ).cycle({ timeout: 5000, slideExpr: $("aside>div").not(".no-cycle") }); } }else{ if(cycle != null){ cycle = null; //console.log('destroy'); $('aside').cycle('destroy'); clearCycleStyle(); } } }); $('aside').hover(function(){ //console.log('pause'); if(cycle != null){ $( 'aside' ).cycle('pause'); } },function(){ //console.log('resume'); if(cycle != null){ $( 'aside' ).cycle('resume'); } }); function clearCycleStyle(){ $('aside').children().each(function(){ if($(this).hasClass('banner')){ /*$(this).css({ 'position':'relative', 'top' : 'auto', 'left': 'auto', 'display' : 'block', 'opacity' : '1' })*/ } $(this).attr("style", ''); }); } if($(".video-topic-wrapper").length > 0) { var $topicWrapperColumn = $(".video-topic-wrapper .column"); if(!$($topicWrapperColumn).hasClass("full")){ $topicWrapperColumn.mouseenter(function() { //$(this).find('.video-category-title').addClass('active'); $(this).addClass('active'); }).mouseleave(function () { //$(this).find('.video-category-title').removeClass('active'); $(this).removeClass('active'); }); } } });