我正在try 从js中的一个css转换矩阵返回值.
这个元素是一个div,使用以下css:
transform: translateY(-560px)
在我的JS中,我当前通过执行以下操作来获取矩阵:
const el = document.querySelector('[data-holder]')
return getComputedStyle(el).transform
上面的代码给了我:
matrix(1, 0, 0, 1, 0, -560)
如何从矩阵中提取最后一个值?