Created
March 19, 2013 12:32
-
-
Save charleslouis/5195717 to your computer and use it in GitHub Desktop.
cssTransitionModernizr - If Css animation are not supported : apply jQuery.animate().
Requires Modernizr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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