2012-03-26 5 views
1

SlideInまたはSlideOut中にコンポーネントの幅を減らす問題を解決するのに役立つ人はいますか?私はExt JSバージョン4.1 RC1を使用しています。slideInとslideOutはコンポーネントの幅を狭くします

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

あなたの質問は、あなたがやろうとしているものに関しては非常に明確ではありません。しかし、投稿されたコードは機能していませんでした。私はそれが内と外にスライドするようになったが、これはあなたがすることを意味する方法であるかどうかわからない: http://jsfiddle.net/dbrin/qDhXg/

あなたが中心にあなたのパネルをマークやフィット感とボーダーレイアウトを交換するか必要がある(jsfiddleを参照)

+0

あなたの答えをありがとう。しかし、私は私の "通知パネル"が中央に整列されることを望む。 – shub

+1

センター位置決めがありません。アンカーレイアウトを使用して50%のオフセットを指定するか、センターレイアウトのユーザー拡張のどこかを見たことがあります。 – dbrin

+0

また、アンカーレイアウトで50%のオフセットを設定する必要があることも知っていますか? – shub

関連する問題