我正在尝试在Polymer中创建自己的开门动画,但我无法使perspective
起作用。我的animationConfig
看起来像这样:
animationConfig: {
value: function() {
return {
testTransform: {
name: 'transform-animation',
node: this.$.door,
transformFrom: 'rotateY(0deg) perspective(300)',
transformTo: 'rotateY(-110deg) perspective(300)'
}
}
}
}
然后是几种方法:
doorClick: function() {
console.log("clicked the door")
if (!this.opened) {
this.open()
} else {
this.close()
}
},
open: function() {
this.opened = true;
this.playAnimation('testTransform');
}
如果我只将rotateY
放在transformFrom
和transformTo
中,则旋转工作但不是单独使用透视和透视也不起作用。我在控制台中也没有出现任何错误。
答案 0 :(得分:0)
我将perspective属性添加到父元素而不是我动画的元素。