1

How can I get the mouse coordinates on the webpage (not the body as it may be smaller than the viewport) but do not register any scrollbar clicks. This code below also tracks any coordinates from clicks that happen on the scrollbars and I don't want that

$(document).bind('mousedown', function(evt) {
        var x = evt.pageX + document.body.scrollLeft;
        var y = evt.pageY + document.body.scrollTop;

});
  • When you say "do not register any scrollbar clicks", do you mean just the window's scrollbar? Or do you mean any scrollbar on any overflowing block level element such as a div? – John Hartsock Apr 29 '14 at 18:31
  • only the window's scrollbar – user3065579 Apr 29 '14 at 18:36
  • This might help http://stackoverflow.com/questions/10045423/determine-whether-user-clicking-scrollbar-or-content-onclick-for-native-scroll – John Hartsock May 02 '14 at 17:48
  • unfortunately, no. the browser scrollbar is not a document element. but i don't really care about noticing the click but rather neglecting it... is the only possibility to hardcode the scrollbars for specific browsers? :( – user3065579 May 04 '14 at 19:28

0 Answers0