Skip to content
Permalink
Browse files

Fix 2 pixels error on mouse coords in IE

  • Loading branch information
eduardolundgren committed Jun 1, 2008
1 parent 169662d commit f9e28552c4adea809eca4128528ced427e5902c9
Showing with 9 additions and 2 deletions.
  1. +9 −2 ui/tests/jquery.useraction.js
@@ -237,9 +237,16 @@ $.extend($.userAction.prototype, {

} else if (document.createEventObject) {
evt = document.createEventObject();

// assign available properties
$.extend(evt, EVT)

// IE won't allow assignment to toElement or fromElement
evt.relatedTarget = EVT.relatedTarget;

// fix for 2 pixels bug from mousecords
evt.pageX = o.x; evt.pageY = o.y;

// fire the event
this.target.fireEvent(StringPool.ON + type, evt);
}
@@ -303,8 +310,8 @@ $.extend($.userAction.prototype, {
findCenter: function(offset) {
var el = $(this.target), o = el.offset();
return {
x: o.left + (((offset||[0, 0])[0]) || 0) + el.width() / 2,
y: o.top + (((offset||[0, 0])[1]) || 0) + el.height() / 2
x: o.left + (((offset||[0, 0])[0]) || 0) + el.outerWidth() / 2,
y: o.top + (((offset||[0, 0])[1]) || 0) + el.outerHeight() / 2
};
}
});

0 comments on commit f9e2855

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