2012年2月1日 星期三

[Sencha Touch] Change Style of Carousel item on the fly

Aim: disable touch callout and text selection :

listen to certain carousel event, say, doubletap
and then execute following code to apply new style:

var c = new Ext.Carousel({
   .....
    listeners: {
         doubletap: function(e){
              Ext.get('{someHtmlElementID}').addCls('deselect');
              this.doLayout();
         }
    }
....
});

where style 'deselect' is declared in css as follow:

.deselectStyle{
  -webkit-user-select: none;
 -webkit-touch-callout:none;
}

沒有留言:

張貼留言