<style id="sss">
.movementdiv
{
        position:absolute;
        border:slategray 2px solid;
        padding:0;
        z-index:1;
        margin:0;
}
</style>

在IE里面,js代码:
var obj = document.getElementById(“sss”);
obj.styleSheet.rules[0].style.width = 100;
obj.styleSheet.rules[0].style.height = 100;
就可以把页面中所有class为“movementdiv”的div都改成长100px;宽100px;

firefox里面不能用ID取得,只能通过document来取得: 这样OK~
document.styleSheets[0].cssRules[0].style.width = 100;
document.styleSheets[0].cssRules[0].style.height = 100;

© 2012 Hedgehog Suffusion theme by Sayontan Sinha