刚刚看了最新的霓虹灯-动画-网页的多播视频,并尝试了一个基本的设置,但我的动画不工作。它出现在窗口,但仅此而已。这是索引页:
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src='../../../bower_components/webcomponentsjs/webcomponents-lite.js'></script>
<link rel="import" href="../../../bower_components/neon-animation/neon-animated-pages.html">
<link rel="import" href="../../../bower_components/paper-material/paper-material.html">
<link rel="import" href="../../../bower_components/paper-item/paper-item.html">
<link rel="import" href="../../../bower_components/iron-flex-layout/iron-flex-layout.html">
<link rel="import" href="../../../bower_components/neon-animation/neon-animations.html">
<link rel="import" href="x-module">
</head>
<body class="fullbleed">
<neon-animated-pages class="flex" selected="1">
<x-module></x-module>
</neon-animated-pages>
</body>
</html>以下是其中的要素:
<link rel="import" href="../../../bower_components/polymer/polymer.html">
<link rel="import" href="../../../bower_components/neon-animation/neon-animatable-behavior.html">
<link rel="import" href="../../../bower_components/neon-animation/animations/slide-from-right-animation.html">
<link rel="import" href="../../../bower_components/paper-material/paper-material.html">
<dom-module id="x-module">
<style>
</style>
<template>
<paper-material>
<h1>HELO</h1>
</paper-material>
</template>
<script>
Polymer({
is:'x-module',
behaviors: [Polymer.NeonAnimatableBehavior,
Polymer.NeonAnimationRunnerBehavior],
properties:{
animationConfig:{
value: function() {
return {
'entry': {
name: 'slide-from-right-animation',
node: this,
timing:{
duration: 10
},
},
'exit': {
name: 'slide-right-animation',
node: this,
timing:{
duration: 10
},
}
};
}
}
},
});
</script>
</dom-module>我增加了时间属性,看看它是否真的发生得太快了。我确信我只是在做一些愚蠢的事情,但我读过自述和演示。我看不出是怎么回事
发布于 2015-09-10 23:54:31
我认为问题是,您需要在neon-animated-pages中提供至少两个元素,以便它知道从/转到什么。
要测试它,只需在里面添加另一个x-element -
<neon-animated-pages class="flex" selected="1">
<x-module></x-module>
<x-module></x-module>
</neon-animated-pages>https://stackoverflow.com/questions/32510913
复制相似问题