javascript - 动画时 NEON 动画页面跳跃

标签 javascript html css polymer web-component

只要页面有动画,它就会跳到最后。内容升降得非常快。

样式:

:host {
            display: block;
            padding: 10px;
        }

        #animatedPages .iron-selected {
            position: static;
        }

        #animatedPages{
            overflow: hidden;
        }

HTML:

 <paper-card class="fullwidth" heading="{{heading}}">
        <div class="card-content">
            <neon-animated-pages id="animatedPages"
                                 selected="0"
                                 entry-animation="[[entryAnimation]]"
                                 exit-animation="[[exitAnimation]]">
                <neon-animatable>
                    <paper-input label="Wat is de actieve ingrediënt in paracetamol?"></paper-input>
                </neon-animatable>
                <neon-animatable>
                    <paper-input label="Hoeveel is de max inname van hoestdrank per dag?"></paper-input>
                </neon-animatable>
            </neon-animated-pages>
        </div>
        <div class="card-actions">
            <div class="layout-horizontal">
                <paper-fab icon="arrow-back" on-tap="previousQuestion"></paper-fab>
                <paper-fab icon="[[nextButtonIcon]]" class="margin-left-auto" on-tap="nextQuestion"
                           id="nextButton"></paper-fab>
            </div>
        </div>
    </paper-card>

相关js:

 nextQuestion: function () {
            if (!this.checkIfFinalQuestion()) {
                this.entryAnimation = "slide-from-right-animation";
                this.exitAnimation = "slide-left-animation";
                this.$.animatedPages.selectNext();
                if (this.checkIfFinalQuestion()) {
                    return this.transformNextButtonToSendButton(true);
                }
                return this.transformNextButtonToSendButton(false);
            }
        },

        previousQuestion: function () {
            if(this.checkIfFirstQuestion()){
                return;
            }
            this.entryAnimation = "slide-from-left-animation";
            this.exitAnimation = "slide-right-animation";
            this.$.animatedPages.selectPrevious();
            if(!this.checkIfFinalQuestion()){
                return this.transformNextButtonToSendButton(false);
            }
        },

我已经尝试从 :host 中删除填充,但这没有帮助。我已将 position: static 放在 .iron-selected 上,否则 neon-animatable 将无法获得足够的高度。

最佳答案

显然这是一个已知的 chrome 错误,它不会在 FireFox 中发生。错误报告:https://bugs.chromium.org/p/chromium/issues/detail?id=649195#

关于javascript - 动画时 NEON 动画页面跳跃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39766305/

相关文章:

javascript - 将每个页面的 javascript 合并到一个文件中,还是提供页面特定的文件?

html - 用于解析 HTML 的 libxml 快速包装器

响应式设计的 HTML/CSS 居中问题

javascript - 单击按钮时自动更新表格

javascript - 迭代对象数组以创建后列表

javascript - Angularjs:自定义指令上的递归错误太多

html - 如何从javascript中的HTML5视频元素获取媒体流对象

javascript - Jquery 显示更多 用高度而不是字符显示更少

javascript - 在网站上查找动画代码

javascript - 在 JSContext 中暂停/停止评估脚本