首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >霓虹灯动画页面不只是出现在窗口中。

霓虹灯动画页面不只是出现在窗口中。
EN

Stack Overflow用户
提问于 2015-09-10 20:17:59
回答 1查看 531关注 0票数 0

刚刚看了最新的霓虹灯-动画-网页的多播视频,并尝试了一个基本的设置,但我的动画不工作。它出现在窗口,但仅此而已。这是索引页:

代码语言:javascript
复制
<!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>

以下是其中的要素:

代码语言:javascript
复制
<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>

我增加了时间属性,看看它是否真的发生得太快了。我确信我只是在做一些愚蠢的事情,但我读过自述和演示。我看不出是怎么回事

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-09-10 23:54:31

我认为问题是,您需要在neon-animated-pages中提供至少两个元素,以便它知道从/转到什么。

要测试它,只需在里面添加另一个x-element -

代码语言:javascript
复制
<neon-animated-pages class="flex" selected="1">
    <x-module></x-module>
    <x-module></x-module>
</neon-animated-pages>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32510913

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档