$(document).ready(function() { $('.slideshow').each(function(){ $(this).Slider({ speed: 200, interval: 5000, effect: 'slide', auto: 1, addcontrols: 0, livecontrols: 0, addnextprev: 0, livenextprev: 0, externalcontrols: 1 }); }); window.onload = function() { $('.carrousel').each(function(){ $(this).Carrousel({ speed: 200, interval: 5000, auto: 0 }); }); } $('iframe').on('load',function(){ this.style.height = this.contentWindow.document.body.scrollHeight + 'px'; console.log(this.contentWindow.document.body.scrollHeight); }); $("a.fancybox").fancybox(); $('html').click(function() { $("div.lang-switch").children('ul').hide(); }); $("div.lang-switch").children('a').click(function(event){ event.stopPropagation(); $(this).parent().children('ul').slideToggle(250); }); $('.gallery').children('.photo').hover( function () { $(this).find('span.description').slideToggle(); } ); $('a.tlvl').each(function(){ var delay; var canhide = false; $(this).parent().hover( function(){ if(canhide!==true || delay > 0) { clearTimeout(delay); $(this).closest('ul').find('.submenu').hide(); $(this).closest('ul').find('.tlvl').removeClass('active'); } $(this).find('.tlvl').addClass('active'); $(this).find('.submenu').slideDown(); }, function(){ clearTimeout(delay); obj = this; delay = setTimeout(function(){ $(obj).find('.submenu').slideUp(function(){ $(obj).find('.tlvl').removeClass('active'); canhide = true; }); }, 500); }); }); });