隐藏如下面这个东西:
实现鼠标移开菜单内容时会隐藏,还有缺陷是点击开启菜单,不经过菜单就移开鼠标,则无法出发监听:
mouseleave( Ext.menu.Menu menu, Ext.EventObject e, Object eOpts )
具体代码:
菜单内容:
var menu = new Ext.menu.Menu({
items: [{
text : '标准地址',
tooltip : '切换到标准地址',
// handler : function() {
// mapframe.window.changeComment(1);
// return false;
},
// icon : 'resources/ext4/icons/note.png'
}, {
text : '备注信息',
tooltip : '切换到备注信息',
// handler : function() {
// mapframe.window.changeComment(0);
// return false;
},
// icon : 'resources/ext4/icons/note_add.png'
}
],
listeners : {
mouseleave: function(obj,e){ //重点
<span style="white-space:pre"> </span> obj.hide();
}
}
});
菜单:
var changeCommentTbar = '';
if($('#changeComment').val() == 1){
changeCommentTbar = [
'-', {
text : '切换标注信息',
tooltip : '切换标注信息',
// icon : 'resources/ext4/icons/arrow_refresh.png',
menu : menu
}
];
}