我有一个Scorm模块,它在我的js文件中使用window.open在新窗口中打开并设置了resizable = 1:
function OpenScormModuleWindow(scormModuleId, scormModuleUrl, title, width, height)
{
_scormModuleId = scormModuleId;
InitializeUserScormModule();
scormModuleWindow = window.open(scormModuleUrl, "title", "width=" + width + ", height=" + height + ", resizable = 1");
scormModuleWindow.focus();
}
在我看来,我有:
var myWidth = 0, myHeight = 0;
if (typeof (window.innerWidth) == 'number')
{
myWidth = window.innerWidth;
myHeight = window.innerHeight;
}
else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
{
myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight;
}
else if (document.body && (document.body.clientWidth || document.body.clientHeight))
{
myWidth = document.body.clientWidth; myHeight = document.body.clientHeight;
}
我能获取高度和宽度,但是不正确。
现在用户可以调整大小,当窗口大小正确时,如何获取高度和宽度?
我需要获取这些值,以便保存它,下次打开窗口时它的大小是正确的。
谢谢。