PDA

View Full Version : Different CSS for landscape/portrait



kristalaz
17 Feb 2011, 8:46 AM
Hello,

im stuck in developing my app. How can i use seperate css ( one for landscape, other for portrait) for panel elements?
And is it possible to add an event listener who fires an event if orientation has changed? I saw just click events

Thanks for your help

mitchellsimoens
17 Feb 2011, 11:12 AM
There is an orientation listener and you can add/remove classes. Something like this:


listeners: {
scope: this,
orientationchange: function(panel, orientation) {
if (orientation === "landscape") {
this.removeCls("classname");
this.addCls("classname");
} else {
this.removeCls("classname");
this.addCls("classname");
}
}
}