Skip to content

Instantly share code, notes, and snippets.

@charleslouis
Created March 19, 2013 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save charleslouis/5195717 to your computer and use it in GitHub Desktop.
Save charleslouis/5195717 to your computer and use it in GitHub Desktop.
cssTransitionModernizr - If Css animation are not supported : apply jQuery.animate(). Requires Modernizr
function cssTransitionModernizr(){
if(!Modernizr.csstransitions) { // Test if CSS transitions are supported
$(function() {
$('a').hover(function(){
$(this).animate({padding:'34.277% 0 0'},{queue:false,duration:500});
$(this).find('p').animate({top:'0', opacity:'1'},{queue:false,duration:500});
}, function(){
$(this).animate({padding:'36% 0 0'},{queue:false,duration:500});
$(this).find('p').animate({top:'100px',opacity:'0'},{queue:false,duration:500});
});
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment