Skip to content
Permalink
Browse files

Fix the special event handler for mouseover/out events.

And use the /dist version of jquery.js, willya?
  • Loading branch information...
dmethvin authored and timmywil committed Sep 8, 2011
1 parent 8ba5010 commit 0ec71ac707fc3edce6ee67a54da6c779164812f4
Showing with 4 additions and 2 deletions.
  1. +3 −1 src/event.js
  2. +1 −1 test/hovertest.html
@@ -717,11 +717,13 @@ jQuery.each({
selector = handleObj.selector,
oldType, ret;

// NB: No relatedTarget if the mouse left/entered the browser window
if ( selector && related ) {
// Delegated event; find the real relatedTarget
related = jQuery( related ).closest( selector )[0];
}
if ( !related || related !== target && !jQuery.contains( target, related ) ) {
// For mouseover/out, contains isn't needed; handle() already determined it's the right target
if ( !related || handleObj.origType === event.type || (related !== target && !jQuery.contains( target, related )) ) {
oldType = event.type;
event.type = handleObj.origType;
ret = handleObj.handler.apply( this, arguments );
@@ -1,7 +1,7 @@
<html>
<head>
<title>Hover tests</title>
<script src="http://code.jquery.com/jquery-1.6.2.js" type='text/javascript'></script>
<script src="../dist/jquery.js" type='text/javascript'></script>
<style>
/* Remove body dimensions so we can test enter/leave to surrounding browser chrome */
body, html {

0 comments on commit 0ec71ac

Please sign in to comment.
You can’t perform that action at this time.