原文地址:http://www.uncletoo.com/html/jsjquery/566.html
JQuery獲取瀏覽器窗口的高度和寬度
$(document).ready(function() { alert($(window).height()); //瀏覽器時下窗口可視區域高度 alert($(document).height()); //瀏覽器時下窗口文檔的高度 alert($(document.body).height());//瀏覽器時下窗口文檔body的高度 alert($(document.body).outerHeight(true));//瀏覽器時下窗口文檔body的總高度 包括border padding margin alert($(window).width()); //瀏覽器時下窗口可視區域寬度 alert($(document).width());//瀏覽器時下窗口文檔對於象寬度 alert($(document.body).width());//瀏覽器時下窗口文檔body的高度 alert($(document.body).outerWidth(true));//瀏覽器時下窗口文檔body的總寬度 包括border padding margin } )
更多前端技術,請登錄http://www.uncletoo.com