html bottom 点击,HTML DOMRect bottom用法及代码示例

在Web API中,有一个DOMRect接口,它的底部有一个属性,它使我们可以看到DOMRect对象的底部。它返回y +高度坐标值,或者如果高度为负,则返回y。

用法:

var recX = DOMRect.bottom;

返回类型:

Double value

范例1:当高度为正时

DOMRect bottom property

GeeksForGeeks

DOMRect bottom property

Get bottom

function getDOMRect() {

var myDOMRect = new DOMRect(0, 0, 100, 100);

var recbottom = myDOMRect.bottom;

document.getElementById(

'DOMRect').innerHTML = recbottom;

}

输出:

在单击按钮之前:

f144930e227ec9362c87b6c38f8c043d.png

单击按钮后:

43cdb68542af647c652350aeafeee42d.png

范例2:当高度为负数时

DOMRect bottom property

GeeksForGeeks

DOMRect bottom property

Get bottom

function getDOMRect() {

var myDOMRect = new DOMRect(0, 0, 100, -100);

var recbottom = myDOMRect.bottom;

document.getElementById('DOMRect').innerHTML = recbottom;

}

输出:

在单击按钮之前:

f144930e227ec9362c87b6c38f8c043d.png

单击按钮后:

405b3f94336cb31f5ea6aa480995630c.png

支持的浏览器:

谷歌浏览器

Safari 10.1

Firefox

Opera

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值