We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe4ae30 commit de3fc00Copy full SHA for de3fc00
tests/jquery.simulate.js
@@ -123,10 +123,10 @@ $.extend($.simulate.prototype, {
123
this.simulateEvent(target, "click", coord);
124
},
125
findCenter: function(el) {
126
- var el = $(this.target), o = el.offset();
+ var el = $(this.target), o = el.offset(), d = $(document);
127
return {
128
- x: o.left + el.outerWidth() / 2,
129
- y: o.top + el.outerHeight() / 2
+ x: o.left + el.outerWidth() / 2 - d.scrollLeft(),
+ y: o.top + el.outerHeight() / 2 - d.scrollTop()
130
};
131
}
132
});
0 commit comments