$(document).ready(function(){ var ie7 = false; defLogos = $('#defined_logos'); ver = parseInt($.browser.version); if(ver <=7) { ie7 = true; } if ($.browser.msie ) { if (ver <=7 || ver >=9) { $('.eachLogoGS').css('visibility','visible'); grayLogos = $('.eachLogoGS'); grayLogos.css('visibility','visible').hide(); var loaded =0; grayLogos.each(function() { loaded++; if (loaded == 1) { $('.eachLogoGS').css('visibility','visible'); $('.eachLogoGS').each(function(){ $(this).css('display',''); VAlign(this); }); $('.eachLogoGS').each(function(){ $(this).css('display',''); $(this).addClass('hideOnHover'); var nextLogo = $(this).parent() .find('img.eachLogo') .addClass('showOnHover') .css('display','') .css('margin-top',$(this).css('margin-top')) ; }); } }); } else { grayLogos = $('.eachLogoGS'); grayLogos.css('visibility','visible').hide(); var loaded = 1; grayLogos.each(function(){ src = $(this).attr('src'); $.get(src,function(){ loaded++; if (loaded == grayLogos.length) { $('.eachLogoGS').css('visibility','visible'); $('.eachLogoGS').each(function(){ $(this).css('display',''); VAlign(this); }); $('.eachLogoGS').each(function(){ $(this).css('display',''); $(this).addClass('hideOnHover'); var nextLogo = $(this).parent() .find('img.eachLogo') .addClass('showOnHover') .css('display','') .css('margin-top',$(this).css('margin-top')) ; }); } }); }); } } else { var lp=0; $('.eachLogoGS').each(function(){ lp++; $(this).delay(lp*300).queue(function(){ $(this).css('visibility','visible'); $(this).show(); var prevOpacity = $(this).css('opacity'); var currOpacity = 0; $(this).css('opacity',currOpacity); while(currOpacity=prevOpacity) { $(this).addClass('hideOnHover'); var nextLogo = $(this).parent() .find('img.eachLogo') .addClass('showOnHover') .css('display',''); VAlign(this); nextLogo.css('margin-top',$(this).css('margin-top')); } } }); }); } $('.VAlign').each (function(){ VAlign(this); }) }); function VAlign(elm) { var elmType = $(elm).get(0).nodeName.toLowerCase(); if (elmType=='img') { pHeight = parseInt(defLogos.length ? defLogos.css('height') : $(elm).parent().height()); thisHeight = $(elm).height(); if (pHeight == 0 || thisHeight == 0) { return false; } //alert(pHeight+':'+thisHeight); if (thisHeight < pHeight) { var marginTop = parseInt($(elm).css('margin-top'))+parseInt((pHeight-thisHeight)/2); $(elm).css('margin-top',marginTop+'px'); } } else { pHeight = $(elm).parent().height(); thisHeight = $(elm).outerHeight(); if (pHeight == 0 || thisHeight == 0) { return false; } if (thisHeight < pHeight) { var marginTop = parseInt($(this).css('margin-top'))+parseInt((pHeight-thisHeight)/2); $(elm).css('margin-top',marginTop+'px'); } } }