[Mapbender-commits] r7774 - branches/2.7/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Apr 15 04:27:15 EDT 2011
Author: verenadiewald
Date: 2011-04-15 01:27:15 -0700 (Fri, 15 Apr 2011)
New Revision: 7774
Modified:
branches/2.7/http/javascripts/map_obj.js
Log:
add window scroll values for left and top to mouse position for correct mouse position in IE when page contains scrollbars
Modified: branches/2.7/http/javascripts/map_obj.js
===================================================================
--- branches/2.7/http/javascripts/map_obj.js 2011-04-14 09:48:28 UTC (rev 7773)
+++ branches/2.7/http/javascripts/map_obj.js 2011-04-15 08:27:15 UTC (rev 7774)
@@ -198,13 +198,21 @@
});
};
- // using the normalized jQuery event
+ // using the normalized jQuery event
this.getPos = function (e) {
var $dom = $(this.getDomElement());
- return new Mapbender.Point(
- e.pageX - $dom.offset().left,
- e.pageY - $dom.offset().top
- );
+ if ( $.browser.msie ) {
+ return new Mapbender.Point(
+ e.pageX - $dom.offset().left + $(window).scrollLeft(),
+ e.pageY - $dom.offset().top + $(window).scrollTop()
+ );
+ }
+ else {
+ return new Mapbender.Point(
+ e.pageX - $dom.offset().left,
+ e.pageY - $dom.offset().top
+ );
+ }
};
this.getMousePosition = function (event) {
More information about the Mapbender_commits
mailing list