Forked from jonraasch/jQuery.support-transition.js
Last active
January 26, 2016 03:10
-
-
Save ghostcode/ccd96651b97f16836197 to your computer and use it in GitHub Desktop.
Extends the jQuery.support object to CSS3 transition
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 getVendorPropertyName(prop) { | |
// Handle unprefixed versions (FF16+, for example) | |
if (prop in div.style) return prop; | |
var prefixes = ['Moz', 'Webkit', 'O', 'ms']; | |
var prop_ = prop.charAt(0).toUpperCase() + prop.substr(1); | |
for (var i=0; i<prefixes.length; ++i) { | |
var vendorProp = prefixes[i] + prop_; | |
if (vendorProp in div.style) { return vendorProp; } | |
} | |
} |
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
// jQuery.support.transition | |
// to verify that CSS3 transition is supported (or any of its browser-specific implementations) | |
$.support.transition = (function(){ | |
var thisBody = document.body || document.documentElement, | |
thisStyle = thisBody.style, | |
support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined; | |
return support; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment