firefox, chrome, safari 底下,至少會≧ iframe 的高度
但 IE 只會計算有內容的高度
請改用 dom.js 裡的 function
function $getBrowserSize()
{
var width, height;
if (gBrowser.isIE)
{
if ($getDoctype())
{
width = document.documentElement.clientWidth;
height = document.documentElement.clientHeight;
}
else
{
width = document.getElementsByTagName('body')[0].clientWidth;
height = document.getElementsByTagName('body')[0].clientHeight;
}
}
else
{
width = window.innerWidth;
height = window.innerHeight;
}
return {width:width, height:height};
}
但 IE 只會計算有內容的高度
請改用 dom.js 裡的 function
function $getBrowserSize()
{
var width, height;
if (gBrowser.isIE)
{
if ($getDoctype())
{
width = document.documentElement.clientWidth;
height = document.documentElement.clientHeight;
}
else
{
width = document.getElementsByTagName('body')[0].clientWidth;
height = document.getElementsByTagName('body')[0].clientHeight;
}
}
else
{
width = window.innerWidth;
height = window.innerHeight;
}
return {width:width, height:height};
}
全站熱搜
留言列表