An update on Blocka's solution as it doesn't work with Firefox correctly:
if ((typeof e.fromElement != 'undefined' && !e.fromElement.length) ||
(typeof e.fromElement == 'undefined' && e.target.tagName != 'SELECT')) {
// perform your mouseleave logic
}