选择neon-animatable
页后,是否存在页面动画完成事件的处理程序?我在此处使用的_onNeonAnimationFinish
方法仅处理dom-module
容器的动画完成事件。
模板摘录:
<neon-animated-pages class="fit" selected="{{selectedPage}}" attr-for-selected="id" entry-animation="slide-from-right-animation" exit-animation="slide-left-animation" on-iron-select="_pageChanged">
<neon-animatable id="page1" class="fit">1</neon-animatable>
<neon-animatable id="page2" class="fit">2</neon-animatable>
<neon-animatable id="page3" class="fit">3</neon-animatable>
</neon-animated-pages>
脚本:
Polymer({
is: "popup-view",
behaviors: [
Polymer.PaperDialogBehavior,
Polymer.NeonAnimationRunnerBehavior
],
listeners: {
'neon-animation-finish': '_onNeonAnimationFinish'
},
_onNeonAnimationFinish: function() {
console.log("*** _onNeonAnimationFinish ***"); // only called when container animation completes
if (this.opened) {
this._finishRenderOpened();
} else {
this._finishRenderClosed();
}
},
答案 0 :(得分:3)
尝试将事件处理程序添加到<neon-animated-pages>
元素。
<neon-animated-pages on-neon-animation-finish="_onNeonAnimationFinish" ...