获取当前页面的宽度和高度

jQuery:获取当前打开页面的宽度和高度:

var windowheight = $(window).height() - 20;
var windowwidth = $(window).width() - 20;
if (windowheight > 600){
    windowheight = 600;
}
if (windowwidth > 1100){
    windowwidth = 1100;
}
        

猜你喜欢

转载自blog.csdn.net/qq_36521848/article/details/106203128