如何判斷屏幕分辨率、大小、瀏覽器版本


一、瀏覽器版本

1.js判斷

2..NET判斷

二、屏幕大小和文檔大小

1.js判斷

2..NET判斷

二、屏幕分辨率

1.js判斷

screen.width

screen.height

2..NET判斷

HttpBrowserCapabilitiesBase bc = Request.Browser;

ViewBag.Swidth = bc.ScreenPixelsWidth.ToString();
ViewBag.Sheight = bc.ScreenPixelsHeight.ToString();

 

 

附:通過Js來獲取所有屏幕適配的總結

http://blog.csdn.net/qq_16559905/article/details/50474199

 

"屏幕分辨率為:"+screen.width+"*"+screen.height

"屏幕可用大小:"+screen.availWidth+"*"+screen.availHeight

"網頁可見區域寬:"+document.body.clientWidth

"網頁可見區域高:"+document.body.clientHeight

"網頁可見區域寬(包括邊線的寬):"+document.body.offsetWidth 

"網頁可見區域高(包括邊線的寬):"+document.body.offsetHeight 

"網頁正文全文寬:"+document.body.scrollWidth

"網頁正文全文高:"+document.body.scrollHeight

"網頁被卷去的高:"+document.body.scrollTop

"網頁被卷去的左:"+document.body.scrollLeft

"網頁正文部分上:"+window.screenTop

"網頁正文部分左:"+window.screenLeft
"屏幕分辨率的高:"+window.screen.height

"屏幕分辨率的寬:"+window.screen.width

"屏幕可用工作區高度:"+window.screen.availHeight

"屏幕可用工作區寬度:"+window.screen.availWidth


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM