1***@qq.com
1***@qq.com
  • 发布:2020-05-25 16:14
  • 更新:2022-01-19 17:46
  • 阅读:591

在H5端以外如何动态设置节点样式

分类:uni-app

我有一组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'}`;
2020-05-25 16:14 负责人:无 分享
已邀请:
野猪佩奇_

野猪佩奇_

请问解决了吗

该问题目前已经被锁定, 无法添加新回复