DOM对象
DOM对象
this 与 e.target
例子1:
<html>
<head>
</head>
<body>
<div id="T"></div>
<body>
<script>
var T = document.getElementById("T");
T.onclick = function () { //用id为"T"的元素注册监听器
alert(event.currentTarget === this); //true
alert(event.target === this); //true
}
</script>
</html>DOM对象
视口数值的获取
object.getBoundingClientRect()

Element.clientWidth与Element.clientHeight
window.outerWidth与window.outerHeight
window.innerWidth与window.innerHeight
document.body.clientWidth与document.body.clientHeight

Last updated