註冊時間: 2010-07-05, 15:45 文章: 1
|
xul中有段語法為: <stack> <vbox id="showImage" flex="1" style="overflow: auto"> </vbox> </stack>
我想用javascript達成如下: <stack> <vbox id="showImage" flex="1" style="overflow: auto"> <image src="file://c:\\..." height="120" weight="120"> <image src="file://c:\\..." height="120" weight="120"> </vbox> </stack>
javascript語法如下: var target = document.getElementById("showImage");
while (...) { temp = new Image(); temp.src = "file://c:\\..."; temp.height = 120; temp.width = 120; ←對width的設定失效@@ target.appendChild(temp); }
但此作法在sidebar中的image width無法被設定, width依然為原圖大小,即"file://c:\\..."圖檔大小 height則可被順利設定成120
煩請大家幫個忙。
|
|