您好我正在使用Phonegap框架开发Android应用程序。我正在使用css中的“内容”设置图像。下面是我的代码。
HTML:
<img id="templateImg" class="templateImg" />
CSS:
.templateImg {
width: 100%;
height: 92%;
content:url('../images/CLASSY_Car_Main.png');
}
JS:
imgSrc = $("#templateImg").css('content');
它正在返回
Android 4.0 +中的 imgSrc = url('../images/CLASSY_Car_Main.png')
但返回
imgSrc=' '
。
如何在运行时为android 2.3获取css内容?