日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

屏幕尺寸

發(fā)布時(shí)間:2023/12/10 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 屏幕尺寸 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

屏幕尺寸分析

<!DOCTYPE html> <script src="js/jquery-1.11.3.js" type="text/javascript"></script> <html> <head><title>aaa</title><style>body{margin:10px;padding:10px;border:10px solid #000;}</style> </head><body><h1>hsjjadsajdjahsjdadhksahjfdgjfgjafjasjgakuiajkshkabcbakahkjhsjdhwihkadhiahdksahdkahkshkdshkhdjshdjsdjshjhakdhakhdjsdjksashk</h1><div>hsjjadsajdjahsjdadhksahjfdgjfgjafjasjgakuiajkshkabcbakahkjhsjdhwihkadhiahdksahdkahkshkdshkhdjshdjsdjshjhakdhakhdjsdjksashkhsjjadsajdjahsjdadhksahjfdgjfgjafjasjgakuiajkshkabcbakahkjhsjdhwihkadhiahdksahdkahkshkdshkhdjshdjsdjshjhakdhakhdjsdjksashkhsjjadsajdjahsjdadhksahjfdgjfgjafjasjgakuiajkshkabcbakahkjhsjdhwihkadhiahdksahdkahkshkdshkhdjshdjsdjshjhakdhakhdjsdjksashk</div><p>Welcome to aaa</p><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1><h1>aaa</h1></body> </html> <script type="text/javascript">document.write("window.innerWidth: "+window.innerWidth+"\n");document.write("window.outerWidth: "+window.outerWidth+"\n");document.write("window.screen.width: "+window.screen.width+"\n");document.write("window.screen.availWidth: "+window.screen.availWidth+"\n");document.write("document.body.clientWidth: "+document.body.clientWidth+"\n");document.write("document.body.offsetWidth: "+document.body.offsetWidth+"\n");document.write("document.body.scrollWidth: "+document.body.scrollWidth+"\n");document.write("$(window).width(): "+$(window).width()+"\n");document.write("$(document.body).width(): "+$(document.body).width()+"\n");document.write("$(document).width(): "+$(document).width()+"\n");
document.write(
"window.innerHeight: "+window.innerHeight+"\n");document.write("window.outerHeight: "+window.outerHeight+"\n");document.write("window.screen.height: "+window.screen.height+"\n");document.write("window.screen.availHeight: "+window.screen.availHeight+"\n");document.write("document.body.clientHeight: "+document.body.clientHeight+"\n");document.write("document.body.offsetHeight: "+document.body.offsetHeight+"\n");document.write("document.body.scrollHeight: "+document.body.scrollHeight+"\n");document.write("$(window).height(): "+$(window).height()+"\n");document.write("$(document.body).height(): "+$(document.body).height()+"\n");document.write("$(document).height(): "+$(document).height()+"\n");document.write("document.body.scrollTop: "+document.body.scrollTop+"\n");document.write("document.body.scrollLeft: "+document.body.scrollLeft+"\n");document.write("window.screenTop: "+window.screenTop+"\n");document.write("window.screenLeft: "+window.screenLeft+"\n"); </script>

?

以上圖均為有滾動(dòng)條↑

width分析:

與滾動(dòng)條無關(guān)

  window.screen.width ,?window.screen.availWidth , window.innerWidth , window.outerWidth 顯示屏的寬度

有滾動(dòng)條

  1.無豎的滾動(dòng)條

    document.body.scrollWidth 和 $(document).width() :?網(wǎng)頁正文全文寬(包括 margin,border,padding,但不包括 滾動(dòng)條);

  2.有豎的滾動(dòng)條

    document.body.scrollWidth 和 $(document).width() :?網(wǎng)頁正文全文寬(包括 margin,border,padding,但包括 滾動(dòng)條,會(huì)忽略滾動(dòng)條);

無滾動(dòng)條

  document.body.scrollWidth , $(document).width() ,?window.screen.width ,?window.screen.availWidth , window.innerWidth , window.outerWidth , $(window).width() 一樣,為顯示屏的寬度;

  document.body.offsetWidth : 不包括margin

  document.body.clientWidth : 不包括margin和border

  $(document.body).width() :不包括padding,border和margin

?

height分析:

height太亂了,老是變化!/(ㄒoㄒ)/~~

轉(zhuǎn)載于:https://www.cnblogs.com/mina-huojian66/p/6138391.html

總結(jié)

以上是生活随笔為你收集整理的屏幕尺寸的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。