$.fn.uaFloater = function() {//submeny wrapper this. on(EV_SET,function(ev) { ev.stopImmediatePropagation(); //No floaters ? if($.inArray(ev.uaData.data.id,[INFO_LOGIN,INFO_PLANS])>0) { ev.uaData.data.id = null; }; switch(ev.uaData.data.id) { case null: case undefined: if(!$(this).css('display')!=='none') { $(this).animate({ width: 0, height: 0, opacity: OPACITY_MIN },TIME_FADE/2,function() { $(this).css({display:'none'}); pContents.html(''); }); }; break; default: //pass info to pContents 'as is'. pContents.trigger($.Event(EV_SET,{uaData:ev.uaData})); //show if necersary if($(this).css('display')==='none') { $(this).css({display:''}).animate({ width: '100%', height: '100%', opacity: OPACITY_MAX },TIME_FADE/2); }; break; }; }). on(EV_RESPONSE,function(ev) { ev.stopImmediatePropagation(); pContents.trigger($.Event(EV_RESPONSE,{uaData:ev.uaData})); }). on(EV_NOTIFY,function(ev) { ev.stopImmediatePropagation(); $(this).trigger($.Event(EV_EXTERN,{uaData:ev.uaData})); }); const pContents = $("#idFloater_Contents",this).uaFloater_Contents(). on(EV_EXTERN,function(ev) { ev.stopImmediatePropagation(); $(this).parent().parent().trigger($.Event(EV_NOTIFY,{uaData:ev.uaData})); }); return this; };