H5 调试 滑动显示的这个元素边界框是怎么显示出来的啊,是因为外边包了一层`section`吗?-灵析社区

silennn

chrome的我做过,我是全局监听鼠标移动事件, document.addEventListener('mousemove', this.mouseMoveListener) mouseMoveListener: function (e) { // 现在好像没有path属性了,但是有个.composedPath() let tempElement = e.path[0]; // tempElement就是当前鼠标位置的元素 } tempElement是一个HTMLElement,它有classList属性,可以用来添加和删除样式,你可以准备一个虚线边界框的样式,判断是添加还是删除样式 tempElement.classList.add(greedColor) tempElement.classList.remove(greedColor)

阅读量:1

点赞量:0

问AI