/* Make header image fade properly when it's height is bigger than it's container */ $(window).resize(function() { fixHeaderTransparency(); }); var waitForFinalEvent = (function () { var timers = {}; return function (callback, ms, uniqueId) { if (!uniqueId) { uniqueId = "Don't call this twice without a uniqueId"; } if (timers[uniqueId]) { clearTimeout (timers[uniqueId]); } timers[uniqueId] = setTimeout(callback, ms); }; })(); function fixHeaderTransparency() { waitForFinalEvent(function(){ var headerImage = document.getElementById('headerImage'); if (headerImage.clientHeight > 500) { headerImage.style['-webkit-mask-image'] = "linear-gradient(to bottom, rgba(0,0,0,1) 40px, rgba(0,0,0,0) 450px)"; } else { headerImage.style['-webkit-mask-image'] = "linear-gradient(to bottom, rgba(0,0,0,1) 40px, rgba(0,0,0,0) 90%)"; } }, 25, "FadingHeaderResize"); } $(document).ready(function() { $(".tooltip").tooltipster({ contentCloning: true, theme: 'tooltipster-punk', functionReady: function(){ var offset = $(this).offset(); $(".tooltipster-base").offset(offset); }, }); $(".tooltip").tooltipster(); $.tooltipster.group("tooltip"); fixHeaderTransparency(); });