提交 92517abb 编写于 作者: 张磊

调整transition示例,修改transition-duration设置时机。

上级 66519c9d
...@@ -29,16 +29,16 @@ ...@@ -29,16 +29,16 @@
} }
this.buttonValue = "关闭图片旋转" this.buttonValue = "关闭图片旋转"
this.times = this.times + 1 this.times = this.times + 1
this.element!.style.setProperty('transform', 'rotate(' + this.times * 360 + 'deg)')
this.element!.style.setProperty('transition-duration', '2000ms') this.element!.style.setProperty('transition-duration', '2000ms')
this.element!.style.setProperty('transform', 'rotate(' + this.times * 360 + 'deg)')
this.isStart = true this.isStart = true
} else { } else {
this.isStart = false this.isStart = false
this.times = 0 this.times = 0
this.onTransitionEndTriggr = false this.onTransitionEndTriggr = false
this.buttonValue = "开启图片旋转" this.buttonValue = "开启图片旋转"
this.element!.style.setProperty('transform', 'rotate(' + this.times * 360 + 'deg)')
this.element!.style.setProperty('transition-duration', '0ms') this.element!.style.setProperty('transition-duration', '0ms')
this.element!.style.setProperty('transform', 'rotate(' + this.times * 360 + 'deg)')
} }
}, },
onEnd() { onEnd() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册