在IE下你可以用currentStyle获得当前的style,Firefox下可以用getComputedStyle Just For IE ... function butOnclick() { var obj = window.parent.document.getElementById("iframe_float_btn") ; alert(obj.id); alert(obj.currentStyle.left); obj.style.left = 100; alert(obj.currentStyle.left); }
Just For IE ...
function butOnclick()
{
var obj = window.parent.document.getElementById("iframe_float_btn") ; alert(obj.id);
alert(obj.currentStyle.left); obj.style.left = 100; alert(obj.currentStyle.left);
}