摘要: var target = event.target || event.srcElement; console.log(target.tagName); //div 首先说EventEvent 对象代表事件的状态,比如事件在其中发生的元素、键盘按键的状态、鼠标的位置、鼠标按钮的状态。事件通常与函数结合 阅读全文
posted @ 2020-04-07 20:30 牛耀民 阅读(300) 评论(0) 推荐(0) 编辑
摘要: 三大系列总结: offset系列经常用于获得元素位置 offsetTop offsetLeft client经常用于获取元素大小 clientWidth clientHeight scroll经常用于获取滚动的距离 scrollTop sccrollLeft offset 翻译过来就是偏移量 Ele 阅读全文
posted @ 2020-04-07 15:05 牛耀民 阅读(202) 评论(0) 推荐(0) 编辑