ну дык это и называется костыль
<div id="la" style="width: 100px; height: 100px; background: #f00;">
<a href="">test</a>
</div>
<script>
function onMouseEnter( elem, callback ) {
if ( "onmouseenter" in elem ) {
if ( elem.addEventListener ) {
elem.addEventListener( "mouseenter", callback, false );
} else {
elem.attachEvent( "onmouseenter", callback );
}
} else if ( elem.addEventListener ) {
elem.addEventListener( 'mouseover', function( event ) {
var relTarg = event.relatedTarget;
while( relTarg && relTarg !== elem && ( relTarg = relTarg.parentNode ) ) {}
if ( relTarg !== elem ) {
callback && callback.call( this, event );
}
}, false );
}
}
function onMouseLeave( elem, callback ) {
if ( "onmouseleave" in elem ) {
if ( elem.addEventListener ) {
elem.addEventListener( "mouseleave", callback, false );
} else {
elem.attachEvent( "onmouseleave", callback );
}
} else if ( elem.addEventListener ) {
elem.addEventListener( 'mouseout', function( event ) {
var relTarg = event.relatedTarget;
while( relTarg && relTarg !== elem && ( relTarg = relTarg.parentNode ) ) {}
if ( relTarg !== elem ) {
callback && callback.call( this, event );
}
}, false );
}
}
var elem = document.getElementById('la');
onMouseEnter( elem, function() {
document.body.appendChild(document.createTextNode('over|'));
});
onMouseLeave( elem, function() {
document.body.appendChild(document.createTextNode('out|'));
});
</script>