我使用 svg.js 编写了一个 flipUp 函数来上下翻转图像。我也需要一个侧翻功能,但我无法通过使用 scale(1,-1) 来实现侧翻功能。谁能帮我吗?
用personalise.js编写的函数flipUp如下:
function flipUp()
{
var angle = parseInt(target.trans.rotation,10) + 180;
//if(angle > 360) angle = angle -360
console.log(angle)
target.animate().rotate(angle)
//target.animate().transform('matrix' ,'-1,0,0,-1,0,0')
}
该函数是从 design.html 调用的,如下所示:
<a href="#" onclick="flipUp()"><img src='flip_up.PNG' alt="" height="20" width="20" style='margin-top:-41px;margin-left:267px'></a>