on-core-animated-pages-transition-end函数

时间:2015-05-27 06:37:24

标签: javascript jquery polymer

我在我的应用中使用了两个“核心动画页面” 一个用于页面导航,另一个用于

我希望在 on-core-animated-pages-transition-end 时加载子元素的内容,但是它会在两个核心动画页面中触发

<core-animated-pages id="pages" on-core-animated-pages-transition-end="{{loadproductsgrid}}" selected="{{route}}" valueattr="hash" transitions="slide-from-right">
    <template repeat="{{page, i in pages}}">
     <section hash="{{page.hash}}" layout="vertical center-center "> 
      </section>
        </template>
 </core-animated-pages>

如何将此限制为一个元素

1 个答案:

答案 0 :(得分:0)

当触发该事件并调用该函数时,您可以检查事件目标id的id以查看发送事件的元素

loadproductsgrid: function (event) {
  if (event.target.id === 'pages') {
    // will only fire if pages is the sending element 
  }
}

希望有所帮助

相关问题