내가 아는 한 가지 방법은 코어 애니메이션의 customEffect 콜백을 사용하는 것입니다. 클릭하면
이 예제는 버튼을 애니메이션을
<script src="http://www.polymer-project.org/components/webcomponentsjs/webcomponents.js"></script>
<link rel="import" href="http://www.polymer-project.org/components/polymer/polymer.html">
<link rel="import" href="http://www.polymer-project.org/components/core-animation/core-animation.html">
<polymer-element name="test-element">
<template>
<core-animation id="animation" duration="1000" easing="ease-in-out" fill="forwards"></core-animation>
<div relative>
<button on-tap="{{go}}" style="position: absolute;">Click me</button>
</div>
</template>
<script>
Polymer({
go: function(e, detail, sender) {
var maxTop = 100;
// animation target
this.$.animation.target = sender;
// custom animation callback
this.$.animation.customEffect = function(timeFraction, target, animation) {
target.style.top = (maxTop * timeFraction) + "px";
};
// being the animation
this.$.animation.play();
}
});
</script>
</polymer-element>
<test-element></test-element>
좋아, 할 것이다. 그리고 나는 아직도 작업을 완화하는 것을 보았습니다. – Jonah