提取页面宽度的问题

来源:互联网 发布:朝鲜第五次核试验知乎 编辑:程序博客网 时间:2024/05/21 15:38
1=document.body.clientWidth;//网页可见区域宽1354/1333/96
  2=document.body.offsetWidth;//包括边线和滚动条的宽1354/1333/1329
  3=document.body.scrollWidth;//网页正文全文宽度1354/1349/1329
  4=document.body.scrollTop;//0/0//0
  5=window.screenTop;//网页正文距离屏幕顶部121/123/142
  6=window.screen.height;//屏幕高度768/768/768
  7=window.screen.availHeight;//屏幕可用高度728/728/728
  8=window.screen.colorDepth;//位彩色32/24/32
  9=window.screen.deviceXDPI;//像素、英寸96/undeinfined/96

  10=document.documentElement.clientWidth;//1345

第一条代码在IE浏览器结果显示错误,正确的代码document.documentElement.clientWidth

0 0
原创粉丝点击