[Mapbender-commits] r7775 - trunk/mapbender/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Apr 15 04:29:51 EDT 2011
Author: verenadiewald
Date: 2011-04-15 01:29:51 -0700 (Fri, 15 Apr 2011)
New Revision: 7775
Modified:
trunk/mapbender/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: trunk/mapbender/http/javascripts/map_obj.js
===================================================================
--- trunk/mapbender/http/javascripts/map_obj.js 2011-04-15 08:27:15 UTC (rev 7774)
+++ trunk/mapbender/http/javascripts/map_obj.js 2011-04-15 08:29:51 UTC (rev 7775)
@@ -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