javascript - YUI App transition "flickers"on showView

标签 javascript css css-transitions yui

我对 YUI 应用程序中的转换有疑问。每次我使用 showView 方法更改 View 时, View 的内容都会向左移动很短的时间,然后返回到它所属的位置。

在此处查看实际效果: http://jsfiddle.net/casperskovgaard/ez7wH/

我使用这个 css 来居中 View :

#content {
  margin: auto;
  width: 400px;
}

如果我删除 css,则 View 不会闪烁...但我需要它居中。

有什么想法吗?

最佳答案

在您的 js 代码的最底部,将 transitions 设置为 false

DEMO

YUI().use('app', 'demo-app', function (Y) {
    'use strict';

    var demoApp = new Y.DemoApp({
        root: '/demo',
        serverRouting: false,
        transitions: false
    });

    demoApp.render();
});

关于javascript - YUI App transition "flickers"on showView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20409610/

相关文章:

javascript - airtable:TypeError:无法读取在 JEST 中运行的未定义的属性 'bind'

javascript - bootbox.js -> 仅当条件为 true 时才在 bootbox.dialog() 中显示按钮

javascript - 如何永久更改对象的样式?

jquery easyslider 在 12 张图像后出现错误

html - 如何使用css制作一个小图标?

css - 如何使 Bootstrap 列的高度相同?

javascript - 返回结果中嵌套标准化数据的 ID 列表

jquery - CSS3 动画从右向左滑动 div 按钮的点击

html - 当我沿 x 轴旋转元素时,尺寸会增加吗?

css - 如何使边框过渡从左到右(悬停时出现边框)