var c=0; var speed=80; var viewPortWidth; var viewPortHeight; function ticker() { o=$('.case:eq('+c+')'); c++; if(c<=$('.case').length) { o.css('display','inline-block'); htmlStr = o.html(); if(o.text() || htmlStr.indexOf('img')) setTimeout(function(){ticker()},5); else ticker(); } } function ticker2(href) { o=$('.case:eq('+c+')'); c++; if(c<=$('.case').length) { o.css('display','none'); setTimeout(function(){ticker2(href)},5); } else location.href=href; } $(function() { getViewport(); /*$('a').live('click', function() { event.preventDefault(); c=0; ticker2($(this).attr('href')); });*/ $(window).resize(function() { getViewport(); location.href='?clientWidth='+viewPortWidth; }); $(function(){ if(!gup('clientWidth')) { if(!0) { location.href='?clientWidth='+(viewPortWidth-20); return; } else { location.href='?'; return; } } else if(gup('clientWidth')!=viewPortWidth-20) { location.href='?'; return; } }); $(window).load(function() { $('#chargement').css('display','none'); ticker(); }); }); function gup( name ) { name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS = "[\\?&]"+name+"=([^&#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( window.location.href ); if( results == null ) return ""; else return results[1]; } function getViewport() { // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight if (typeof window.innerWidth != 'undefined') { viewPortWidth = window.innerWidth, viewPortHeight = window.innerHeight } // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document) else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) { viewPortWidth = document.documentElement.clientWidth, viewPortHeight = document.documentElement.clientHeight } // older versions of IE else { viewPortWidth = document.getElementsByTagName('body')[0].clientWidth, viewPortHeight = document.getElementsByTagName('body')[0].clientHeight } return [viewPortWidth, viewPortHeight]; }