记忆不行,只能记录
style.setAttribute不起作用,另收集设置方式
vwin.style.setAttribute("width",wWidth+"px");
vwin.style.setAttribute("height",wHeight+"px");
vwin.style.setAttribute("left",wLeft+"px");
vwin.style.setAttribute("top",wTop+"px");
vwin.style.setAttribute("backgroundColor","#8bcee4");
在firefox下不起作用,应该是style下面不支持setAttribute了,只能用其他方式了。
有下面几种方式:
vwin.style.cssText="position:absolute;width:"+wWidth+"px"+";height:"+wHeight+"px"+";left:"+wLeft+"px;"+"top:"+wTop+"px"+";background:#8bcee4;";
vwin.style.width="100px";
还引用一个,这个没测试
var oStyle = oNode.getAttribute("style");
// ie
if(oStyle == "[object]") {
oStyle.setAttribute("cssText", strStyle);
oNode.setAttribute("style", oStyle);
} else {
oNode.setAttribute("style", strStyle);
}
| 打印文章 | 这篇文章由admin于2009年3月27日 05:22发表在收集。你可以订阅RSS 2.0 也可以发表评论或引用到你的网站。 |