PDA

View Full Version : Using Ext.Anim.run , to slide one div out of view, and another one into view



qbert65536
8 Feb 2011, 1:54 PM
I have this code


Ext.get('countBreakdownContent').addListener('swipe',
function (c) {
//alert(c.direction);
Ext.Anim.run(this,'slide',
{
direction: c.direction,
scope: this,
after: function () {
this.hide();
var page2 = Ext.get('countBreakdownContent-page2');
Ext.Anim.run(page2,'slide',{ out: false } );

}

});


Which works exactly like I want it when countBreakdownContent-page2 DOES NOT have display: none;. However, I need it it not displayed on page load, I want to simulate the effect of swiping one <div> away and replacing it with another, so I need page2 to be hidden.

Does run() not change the div's display from none to block ?

How can I fix this ? I've tried several options, but whenever page2 has display: none; I can not get the behavior I want.