Calculation left or top ?
<div style="width:100px;height:50px;"></div>
div.style.transform = `rotateZ(45deg)`
// 获取矩阵
let transform = window.getComputedStyle(div)['transform'],
matrix = transform.slice(7, -1).split(',')
To get matrix of a div with javascript, you can try to these
let style = window.getComputedStyle(div);
let transform = style.transform;
let matrix = transform.replace('matrix(', '').replace(')','').split(',')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.