0
此脚本在jQuery 1.9中工作,但在1.8中不起作用。如何将此脚本转换为jQuery 1.8?将脚本从jQuery 1.9转换为1.8
HTML
<div id="container">
<div id="c1" class="aaa" style="text-align:right; color:red top:100px; ">child 1</div>
<div id="c2" class="aaa" style="text-align:left; top:200px; ">child 2</div>
</div>
jQuery脚本
$("#container").children().each(function() {
alert("element ID = " + $(this).attr('id'));
var styleProps = $(this).css(["width",
"height",
"color",
"background-color",
"text-align",
"left",
"top",
"right",
"bottom"]);
$.each(styleProps, function (prop, value) {
alert(prop + " = " + value);
});
});
http://jsfiddle.net/ynternet/tzEHe/5/ - 但它不工作:( – Patrik
再次阅读我的回答接受阵列中的CSS功能不可用jQuery的1.8样本。我提供的作品很好,但你必须真正使用它。 –
对不起,你是对的:)谢谢。 – Patrik