开发者

How to change opacity of a Xul element at runtime?

I've tried

document.getElementById("myId").style = "opacity: 0.5";

but it didn't work:

Error: setting a property that has only a getter

Also looks like t开发者_JS百科here's no "opacity" attribute or parameter (in the box or window element).

Any idea?


Try setting the style as an attribute

document.getElementById("myId").setAttribute("style", "opacity: 0.5");


The opacity is a property of the style property i.e.

document.getElementById("myId").style.opacity = 0.5;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜