有人可以建议是否可以从jQuery webworker进程中访问浏览器的高度/宽度?
这不会返回任何内容:
function getWindowDimensions() {
output = "Screen width: " + $(window).width();
output += "<br />";
output += "Screen height: " + $(window).height();
postMessage(output);
setTimeout("timedCount()", 100);
}
getWindowDimensions();
提前致谢
答案 0 :(得分:0)
检查JSfiddle: - JSFiddle
alert("Width: " + $(window).width());
alert("Height: " + $(window).height());