我使用Phonegap和HTML5(jqueryMobile)创建了一个应用程序。我把rotate3D放在一个div中,
它在谷歌浏览器和Safari中运行良好,但它在Android 2.3+中无效 有什么建议吗?
答案 0 :(得分:1)
我认为这是Android浏览器的一个错误。我创建了一个函数来测试是否支持rotate3d并且它显示是:
function styleSupport( prop )
{
var vendorProp;
var supportedProp;
// capitalize first character of the prop to test vendor prefix
var capProp = prop.charAt(0).toUpperCase() + prop.slice(1);
var prefixes = [ "Moz", "Webkit", "O", "ms" ];
var div = document.createElement( "div" );
if ( prop in div.style )
{
//browser supports standard CSS property name
supportedProp = prop;
}
else
{
//otherwise test support for vendor-prefixed property names
for ( var i = 0; i < prefixes.length; i++ )
{
vendorProp = prefixes[i] + capProp;
if ( vendorProp in div.style )
{
supportedProp = vendorProp;
break;
}
}
}
// avoid memory leak in IE
div = null;
return supportedProp;
}
alert(styleSupport('perspective'));
alert(styleSupport('transform'));
答案 1 :(得分:0)
正如您所见,Android 2.3不支持CSS transforms3D: http://caniuse.com/#feat=transforms3d
尝试升级到Android 4(它适用于我)