2014年9月30日 星期二

[Javascript]三個好用的Height,Width屬性





<script type="text/javascript">

//整個螢幕解析度
document.write("window.screen.height:" + window.screen.height + "<br/>");
document.write("window.screen.width:" + window.screen.width + "<br/>");

//扣掉視窗下面那個工作列
document.write("window.screen.availHeight:" + window.screen.availHeight + "<br/>");
document.write("window.screen.availWidth:" + window.screen.availWidth + "<br/>");

//扣掉視窗下面那個工作列 與瀏覽器工具列和邊框
document.write("document.documentElement.clientHeight:" + document.documentElement.clientHeight + "<br/>");
document.write("document.documentElement.clientWidth:" + document.documentElement.clientWidth + "<br/>");

</script>



From: http://www.dotblogs.com.tw/puma/archive/2009/04/02/javascript-width-height-clientwidth-availwidth-screen.aspx

0 意見:

張貼留言

 

MangoHost Copyright © 2009 Cookiez is Designed by Ipietoon for Free Blogger Template