var trigged=[],scrollTimeout; jQuery(function($){ //Trigger rotate // -------------------- $('#header .thumb').on('rotate',function(){ var $this = $(this); $this.addClass('active'); var tout =getRandomInt(3,10)*1000; setTimeout(function(){ $this.removeClass('active'); },tout) }); var rotateCycle = setInterval(function(){ var thumbs = $('#header .thumb:not(.active)'); $(thumbs[getRandomInt(0,thumbs.length)]).trigger('rotate'); },3000); //Window on resize event //------------------------------------------------ $(window).resize(function(){ var metro = $('#header .container.visible-phone:visible'); var bricks = metro.find('.brick1'); var size = metro.width()/2.4 bricks.css({width:size,height:size}); }); $(window).trigger('resize'); /** * Detect IE 10 */ if (/*@cc_on!@*/false) { $("html").addClass("ie10"); } // if ($.browser.msie && $.browser.version == 10) { // $("html").addClass("ie10"); // } }) //Custom functions /** * Returns a random integer between min and max * Using Math.round() will give you a non-uniform distribution! */ function getRandomInt (min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; }