diff --git a/README.md b/README.md index 5471c487..26d59531 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,10 @@ $.contextMenu is published under the [MIT license](http://www.opensource.org/lic ## Changelog ## +### upcoming ### + +* Fixing reposition/close issue on scrolled documents (Issue #69) + ### 1.5.22 ### * Fixing issue with animation and remove on hide (Issue #64) diff --git a/src/jquery.contextMenu.js b/src/jquery.contextMenu.js index 2b4da541..35289e2c 100755 --- a/src/jquery.contextMenu.js +++ b/src/jquery.contextMenu.js @@ -355,12 +355,11 @@ var // currently active contextMenu trigger }); setTimeout(function() { var $window, hideshow; - // test if we need to reposition the menu if ((root.trigger == 'left' && button == 0) || (root.trigger == 'right' && button == 2)) { if (document.elementFromPoint) { root.$layer.hide(); - target = document.elementFromPoint(x, y); + target = document.elementFromPoint(x - $win.scrollLeft(), y - $win.scrollTop()); root.$layer.show(); selectors = [];