我有一组dom的list样式其中一个值是根据其位置计算出来的,
h5端可以直接通过dom.cssText直接赋值上去,请问其他端如何动态设置节点的样式
const boxes = document.querySelectorAll(".box");
boxes[i].style.cssText = `
transform-origin: ${top ? "center center" : "top center"};
position: ${top ? "fixed" : "absolute"};
top: ${top ? '40px' : 0};
transform: scale(${intersection});
opacity: ${intersection};
width: ${this.boxWidth + 'px'};
height: ${this.boxHeight * 0.9 + 'px'}`;
1 个回复
野猪佩奇_
请问解决了吗