源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

js里取容器大小、定位、距离等属性搜集整理

  • 时间:2022-12-01 20:30 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:js里取容器大小、定位、距离等属性搜集整理
element.clientWidth   //元素的实际宽度,不算边框 element.clientHeight  //元素的实际高度,不算边框 element.offsetWidth   //元素的实际宽度,加上边框 element.offsetHeight  //元素的实际高度,加上边框 element.scrollWidth  //这个说法很多,我测试下来应该是元素实际宽度-滚动条的宽度 element.scrollHeight  //这个说法很多,我测试下来应该是元素实际高度-滚动条的高度 element.offsetLeft   //相对于父对象的距离,ie下如果position设为relative,则是相对于window的距离 element.offsetTop   //相对于父对象的距离,ie下如果position设为relative,则是相对于window的距离 window.screenLeft   //当前窗口距离屏幕距离 only for IE window.screenX   //当前窗口距离屏幕距离 not for IE window.innerWidth  //当前窗口大小(内)not for IE window.outerWidth  //当前窗口大小(外)not for IE window.screen.width //当前屏幕分辨率 window.screen.availWidth //当前屏幕可用分辨率
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部