slideIn и slideOut уменьшают ширину компонента - PullRequest
1 голос
/ 26 марта 2012

Может кто-нибудь помочь мне решить проблему уменьшения ширины компонента во время SlideIn или SlideOut? Я использую Ext JS версии 4.1 RC1.

Ext.onReady(function () {
    Ext.create('Ext.container.Viewport', {
        layout: 'border',
        items: [{
            region: 'north',
            autoHeight: true,
            border: false,
            margins: '0 0 5 0',
            items: [{
                xtype: 'container',
                id: 'con_notification-box',
                cls: 'notification-box',
                hidden: true,
                border: true,
                width: 500,
                height: 0,
                style: {
                    position: 'fixed',
                    minHeight: '75px !important',
                    left: '50%',
                    marginLeft: '-250px',
                    zIndex: '999999',
                    backgroundColor: 'white'
                },
                items:[{
                    xtype: 'container',
                    html: '<p>Insert your information text here.</p>'
                },{
                    xtype: 'container',
                    id: 'con_application-close',
                    cls:   'notification-close',
                    html: '<br />Close'
                }]
            },{
                xtype: 'container',
                html: '<h1 class="x-panel-header">Your title</h1>'
            }]
        }]
    });
    var con_notification_box = Ext.getCmp('con_notification-box').getEl();

    con_notification_box.slideIn('t', {
        easing: 'easeOut',
        duration: 500
    });

    Ext.getCmp('con_application-close').getEl().on('click',function(){
        con_notification_box.slideOut('t', { duration: 2000 });
    });
});

Я был бы очень признателен, если бы вы могли мне помочь.

С уважением, шуб

1 Ответ

1 голос
/ 27 марта 2012

Ваш вопрос не очень ясен относительно того, что вы пытаетесь сделать.Но вы код, как опубликовано, не работает.Я получил его, чтобы скользить внутрь и наружу, но не уверен, что это именно так, как вы хотели: http://jsfiddle.net/dbrin/qDhXg/

Вам нужно либо пометить панель как центр, либо заменить макет границы на fit (см. Jsfiddle)

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...