简体   繁体   English

YUI应用程序过渡在showView上“闪烁”

[英]YUI App transition “flickers” on showView

I have a problem with transitions in a YUI app. 我在YUI应用程序中遇到转换问题。 Every time I change view using the showView method, then the content of the view is move to left for a very short time and then back to where it belongs. 每次我使用showView方法更改视图时,视图的内容都会在很短的时间内向左移动,然后返回到它所属的位置。

See it in action here: http://jsfiddle.net/casperskovgaard/ez7wH/ 在此处查看其运行情况: http : //jsfiddle.net/casperskovgaard/ez7wH/

I use this css to center the view: 我使用此CSS使视图居中:

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

If I remove css, then the view doesn't flicker... But I need it to be centered. 如果删除css,则视图不会闪烁...但是我需要将其居中。

Any ideas? 有任何想法吗?

At the very bottom of your js code, set transitions to false 在您的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();
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM