Javascript 错误的jQuery窗口/屏幕宽度/高度高于1600x900
我得到的窗口和屏幕尺寸如下:Javascript 错误的jQuery窗口/屏幕宽度/高度高于1600x900,javascript,jquery,screen-resolution,Javascript,Jquery,Screen Resolution,我得到的窗口和屏幕尺寸如下: $(window).load(function() { var width = 0; var height = 0; var screen_width = 0; var screen_height = 0; width = $(window).width(); height = $(window).height(); screen_width = screen.width; screen_height = screen.height; }); 铬合金的一切都很好。
$(window).load(function() {
var width = 0;
var height = 0;
var screen_width = 0;
var screen_height = 0;
width = $(window).width();
height = $(window).height();
screen_width = screen.width;
screen_height = screen.height;
});
铬合金的一切都很好。
在Firefox和IE11中,尺寸最多只能达到1600x900!
屏幕宽度和高度均为最大值,不会显示1920x1080屏幕的正确值
e、 g:
实际窗口和屏幕尺寸=1920x979-1920x1080
我的脚本在FF和IE11中显示:931x165-1600x900
(只有Chrome可以正常工作)确定浏览器最大化了吗
width = $(window).width();
height = $(window).height();
输出浏览器窗口的大小
screen_width = screen.width;
screen_height = screen.height;
输出实际监视器的大小
我在我的1680x1050显示器上的FF和Chrome控制台中运行了此操作,两个窗口均最大化:
$(document).ready(function() {
var width = 0;
var height = 0;
var screen_width = 0;
var screen_height = 0;
width = $(window).width();
height = $(window).height();
screen_width = screen.width;
screen_height = screen.height;
console.log('width', width);
console.log('height', height);
console.log('screen_width', screen_width);
console.log('screen_height', screen_height);
});
铬:宽度1665
高度952
屏幕宽度1680
屏风高度1050 Firefox:
宽度1665
高度908
屏幕宽度1680
屏风高度1050
由于浏览器chrome,jquery检查的值永远不会达到屏幕分辨率。您的问题是什么?我在FF和IE中得到了错误的值。我用一个例子编辑了我的文章。您解决了问题吗?@will:非常感谢您的时间。我无法在其他环境中重复此错误。因此,它与我非常旧的HTML4和CSS1模板有一些关系。我现在需要坚持这个模板。一个新的html5布局将在几个月后发布。在那之前我将忽略这个错误。尤其是因为没有那么多>1600px的pc屏幕。