2015-06-24 33 views
1

我在彈出窗口中顯示了一個Flash。當我調整窗口的大小時;閃光燈的寬度增加,而高度保持不變。HTML對象在Internet Explorer 8中調整大小

var objectNode = document.createElement("object"); 
objectNode.appendChild(param); 
objectNode.id = viewerId; 
objectNode.width = "100%"; 
objectNode.height = "100%"; 
objectNode.classid = "clsid:" + SOME_ID; 
containerObject.appendChild(objectNode); 

containerObject是一個HTMLDivElement。這ofcourse在所有瀏覽器除了IE 8

回答

1

對於那些誰希望有一天面對這樣的問題:

有這個是多方面的問題。

  1. 如問題所示設置寬度和高度屬性不起作用。

  2. 在Internet Explorer的高度:如果父母的高度不是100%

改變100%會被忽略containerObject的,身體的和HTML的在這種情況下,以100%的固定問題的高度。

var htm = document.getElementsByTagName("html")[0].style.height="100%"; 
var bod = document.getElementsByTagName("body")[0].style.height="100%"; 
var objectN = document.createElement("object"); 
containerObject.setAttribute("style", "height:100%"); 
objectN.appendChild(param); 
objectN.setAttribute("id", "viewer"); 
objectN.setAttribute("style", "width:100%;height:100%;"); 
objectN.setAttribute("classid", "clsid:" + PLUGIN_CLSID) 
containerObject.appendChild(objectN); 
相關問題