edit
It turned out this provides a bad user experience anyways, so please consider that before using this code :-)
I was able to create a custom widget with that functionality like this:
jQuery.widget("custom.hoverSelectmenu", jQuery.ui.selectmenu, {
_create: function() {
this._super();
var that = this;
this._on( this.button, {
mouseenter: function( event ) {
that.open();
},
mouseleave: function( event ) {
if (event.toElement != that.menu.get(0)) {
that.close();
}
}
});
this._on( this.menu, {
mouseleave: function( event ) {
if (event.toElement != that.button.get(0)) {
that.close();
}
}
});
}
} );
jQuery('.selectbox').hoverSelectmenu({
});
update
The following works in Firefox, Chrome and IE 11 (lower IE not tested)
_leaveWidget: function(event) {
var target = event.toElement || event.relatedTarget || event.target;
if (!(
jQuery.contains(this.button.get(0), target) ||
jQuery(this.button.get(0)).is(target) ||
jQuery.contains(this.menu.get(0), target) ||
jQuery(this.menu.get(0)).is(target)
)) {
this.close();
}
},
_create: function () {
this._super();
var that = this;
this._on(this.button, {
mouseenter: function (event) {
that.open();
},
mouseout: that._leaveWidget
});
this._on(this.menu, {
mouseout: that._leaveWidget
});
},
.on('mouseenter')instead of.hover().hover()add the mouseout functionality