更新时间:2023-01-27 20:13:16
你可以用jQuery获取窗口或文档的大小:
You can get the size of the window or document with jQuery:
// Size of browser viewport.
$(window).height();
$(window).width();
// Size of HTML document (same as pageHeight/pageWidth in screenshot).
$(document).height();
$(document).width();
对于屏幕尺寸,您可以使用 screen
对象:
For screen size you can use the screen
object:
window.screen.height;
window.screen.width;