|
|
@ -28,7 +28,7 @@ |
|
|
|
// ========================= getStyleProperty by kangax ===============================
|
|
|
|
// ========================= getStyleProperty by kangax ===============================
|
|
|
|
// http://perfectionkills.com/feature-testing-css-properties/
|
|
|
|
// http://perfectionkills.com/feature-testing-css-properties/
|
|
|
|
|
|
|
|
|
|
|
|
var prefixes = 'Moz Webkit O ms'.split(' '); |
|
|
|
var prefixes = 'Moz Webkit O Ms'.split(' '); |
|
|
|
|
|
|
|
|
|
|
|
var getStyleProperty = function( propName ) { |
|
|
|
var getStyleProperty = function( propName ) { |
|
|
|
var style = document.documentElement.style, |
|
|
|
var style = document.documentElement.style, |
|
|
@ -82,16 +82,21 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
csstransforms3d: function() { |
|
|
|
csstransforms3d: function() { |
|
|
|
var ret = !!getStyleProperty('perspective'), $style, $div; |
|
|
|
var test = !!getStyleProperty('perspective'); |
|
|
|
if ( ret && 'webkitPerspective' in document.documentElement.style ) { |
|
|
|
// double check for Chrome's false positive
|
|
|
|
$style = $('<style>@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}</style>').appendTo('head'), |
|
|
|
if ( test ) { |
|
|
|
$div = $('<div id="modernizr" />').appendTo('body'); |
|
|
|
var vendorCSSPrefixes = ' -o- -moz- -ms- -webkit- -khtml- '.split(' '), |
|
|
|
ret = $div[0].offsetLeft === 9 && $div[0].offsetHeight === 3; |
|
|
|
mediaQuery = '@media (' + vendorCSSPrefixes.join('transform-3d),(') + 'modernizr)', |
|
|
|
|
|
|
|
$style = $('<style>' + mediaQuery + '{#modernizr{height:3px}}' + '</style>') |
|
|
|
|
|
|
|
.appendTo('head'), |
|
|
|
|
|
|
|
$div = $('<div id="modernizr" />').appendTo('html'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test = $div.height() === 3; |
|
|
|
|
|
|
|
|
|
|
|
$div.remove(); |
|
|
|
$div.remove(); |
|
|
|
$style.remove(); |
|
|
|
$style.remove(); |
|
|
|
} |
|
|
|
} |
|
|
|
return ret; |
|
|
|
return test; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
csstransitions: function() { |
|
|
|
csstransitions: function() { |
|
|
|