Jump to content

JQuery, I have scrollbar in div, how can I get his (current) coordinates X and Y?

- - - - -

  • Please log in to reply
No replies to this topic

#1
Stasonix

Stasonix

    Learning Programmer

  • Members
  • PipPipPip
  • 82 posts
  • Programming Language:C++, PHP, JavaScript, Delphi/Object Pascal, Pascal
  • Learning:C++, PHP, JavaScript, Delphi/Object Pascal
For getting coordinates of scrollbar of the document I am using this:
window.scrollTo(0,99999);

var x = (document.all ? document.scrollLeft : window.pageXOffset);

var y = (document.all ? document.scrollTop : window.pageYOffset);

alert("Х = "+y+" Y = "+y);

but it is does not work for div scrollbar, what I can do?




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users