当前位置: 首页 > news >正文

用git 做网站/成都seo培训班

用git 做网站,成都seo培训班,中国建设银行网站怎么改支付密码忘了怎么办,做wps的网站赚钱scrollHeight: 获取对象的滚动高度。scrollLeft:设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离scrollTop:设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离scrollWidth:获取对象的滚动宽度offsetHeight:获取对象相对于版面或由父坐标 offsetPar…
scrollHeight: 获取对象的滚动高度。

scrollLeft:设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离

scrollTop:设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离

scrollWidth:获取对象的滚动宽度

offsetHeight:获取对象相对于版面或由父坐标 offsetParent 属性指定的父坐标的高度

offsetLeft:获取对象相对于版面或由 offsetParent 属性指定的父坐标的计算左侧位置

offsetTop:获取对象相对于版面或由 offsetTop 属性指定的父坐标的计算顶端位置

event.clientX 相对文档的水平座标

event.clientY 相对文档的垂直座标



event.offsetX 相对容器的水平坐标

event.offsetY 相对容器的垂直坐标

document.documentElement.scrollTop 垂直方向滚动的值

event.clientX+document.documentElement.scrollTop 相对文档的水平座标+垂直方向滚动的量



  以上主要指IE之中,FireFox差异如下:

IE6.0、FF1.06+:

clientWidth = width + padding

clientHeight = height + padding

offsetWidth = width + padding + border

offsetHeight = height + padding + border

IE5.0/5.5:

clientWidth = width - border

clientHeight = height - border

offsetWidth = width

offsetHeight = height

(需要提一下:CSS中的margin属性,与clientWidth、offsetWidth、clientHeight、offsetHeight均无关)



  测试代码:

CODE:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">;

<html xmlns="http://www.w3.org/1999/xhtml]http://www.w3.org/1999/xhtml" lang="gb2312">;

<head>

<head>

<title> 代码实例:关于clientWidth、offsetWidth、clientHeight、offsetHeight的测试比较 </title>

<meta http-equiv="content-type" content="text/html; charset=gb2312" />

<meta name="author" content="枫岩,CnLei.y.l@gmail.com">;

<meta name="copyright" content="http://www.cnlei.com]http://www.cnlei.com" />

<meta name="description" content="关于clientWidth、offsetWidth、clientHeight、offsetHeight的测试比较" />

<style type="text/css" media="all">;

body {font-size:14px;}

a,a:visited {color:#00f;}

#Div_CnLei {

width:300px;

height:200px;

padding:10px;

border:10px solid #ccc;

background:#eee;

font-size:12px;

}

#Div_CnLei p {margin:0;padding:10px;background:#fff;}

</style>

<script type="text/javascript">;

function Obj(s){

return document.getElementById(s)?document.getElementById(s):s;

}

function GetClientWidth(o){

return Obj(o).clientWidth;

}

function GetClientHeight(o){

return Obj(o).clientHeight;

}

function GetOffsetWidth(o){

return Obj(o).offsetWidth;

}

function GetOffsetHeight(o){

return Obj(o).offsetHeight;

}

</script>

</head>

<body>

<p>点击下面的链接:</p>

<div id="Div_CnLei">;

<p><a href="javascript:alert(GetClientWidth('Div_CnLei'));">;GetClientWidth();</a> <a href="javascript:alert(GetClientHeight('Div_CnLei'));">;GetClientHeight();</a></p>

<p><a href="javascript:alert(GetOffsetWidth('Div_CnLei'));">;GetOffsetWidth();</a> <a href="javascript:alert(GetOffsetHeight('Div_CnLei'));">;GetOffsetHeight();</a></p>

</div>

<div id="Description">;

<p><strong>IE6.0、FF1.06+:</strong><br />

clientWidth = width + padding = 300+10×2 = 320<br />

clientHeight = height + padding = 200+10×2 = 220<br />

offsetWidth = width + padding + border = 300+10×2+10×2= 340<br />

offsetHeight = height + padding + border = 200+10×2+10×2 = 240</p>

<p><strong>IE5.0/5.5:</strong><br />

clientWidth = width - border = 300-10×2 = 280<br />

clientHeight = height - border = 200-10×2 = 180<br />

offsetWidth = width = 300<br />

offsetHeight = height = 200</p>

</div>

</body>

</html>
http://www.lbrq.cn/news/1600219.html

相关文章:

  • pc网站转wap网站/成人英语培训班哪个机构好
  • 建站公司服务费包括哪些/seo兼职怎么收费
  • net网站阿里云主机配置/免费网站java源码大全
  • 网站维护更新/营销策略模板
  • 找做模型方案去哪个网站/seo查询排名软件
  • 二级域名 wordpress/郑州seo优化阿亮
  • 沈阳网站制作平台/谷歌广告联盟
  • 搭建论坛网站/百度助手下载
  • 做网赌网站怎么推广拉人/杭州seo推广服务
  • 中国4a广告公司有哪些/东莞seo推广
  • 廊坊怎么做网站/北京刚刚宣布比疫情更可怕的事情
  • 企业网站建设的常见流程/广东百度推广的代理商
  • 网站建设狼雨/海淀网站建设公司
  • 做搞基视频网站/推广营销app
  • 电商网站网址大全/关键字挖掘
  • 武冈 网站建设/app推广文案
  • 毕节市建设厅网站/百度搜索广告怎么收费
  • 重庆网站设计方案/公司软文代写
  • 做的好的ppt下载网站/百度站长收录提交入口
  • 网站怎么做发送邮件的超链接/东莞seo建站公司哪家好
  • 后台更改公司网站背景图片/百度推广手机版
  • 影视网站怎么做app/5118大数据平台官网
  • wordpress 本地运行慢/郑州网络seo公司
  • 微网站建设开发/推广方案设计
  • 苏州专业做网站/爱站网seo工具包
  • 一流的商城网站建设/台州网站建设方案推广
  • 微知微网站建设实训平台/朋友圈广告推广文字
  • 浙江做网站公司/百度一下网页版浏览器
  • 网站设计的流程简答题/天津seo优化公司
  • 专业网站设计专业服务/seo排名方案
  • SQL基础语法
  • 区块链 和 一致性哈希的结合
  • 数据结构:单向链表的函数创建
  • 第N个泰波那契数
  • trace-cmd记录线程被中断打断的时间
  • 【stm32】按键控制LED以及光敏传感器控制蜂鸣器