<div id="div"><div id="div1" style="right:0; position:absolute; border:1px solid #ff9101; width:300px; background:#fdfdf1; height:300px; bottom:0px;" onclick="test(this)"></div>
<div id="div2" style="right:100; position:absolute; border:1px solid #CCCCFF; width:300px; background:#CCFFFF; height:300px; bottom:100px;" onclick="test(this)"></div></div>
<script src="jquery.js"></script>
<script language="javascript">
var index = 0;
function test(div){
var obj = document.getElementById("div");
if($(obj).data("id") == undefined || $(obj).data("id") != div.id){alert(div.style.index);
div.style.zIndex = parseInt(div.style.zIndex) + (index + 2);
$(obj).data("id", div.id);
}
}
</script>
在IE下好用,在FF下zIndex不管用了