js: 获取页面最大的zIndex(z-index)值
// 需要在页面渲染完毕之后执行
function getMaxZIndex(){
let arr = [...document.all].map(e => + window.getComputedStyle(e).zIndex || 0);
return arr.length ? Math.max(...arr) + 1 : 0
}
js: 获取页面最大的zIndex(z-index)值
// 需要在页面渲染完毕之后执行
function getMaxZIndex(){
let arr = [...document.all].map(e => + window.getComputedStyle(e).zIndex || 0);
return arr.length ? Math.max(...arr) + 1 : 0
}