Javascript to detect coordinate of an element

  • artcoder
  • Student
  • Student
  • User avatar
  • Posts: 89
  • Loc: United States

Post 3+ Months Ago

I have an element (a link actually) where on mouse over, I display a hidden layered div using Javascript. But I want this div to be located right underneath the link element.

Due to fact that the page centers horizontally, the link element is in different coordinate on the browser window depending on how the user resizes their window. So I need Javascript code to detect where this link element is (the x and the y) and then position that div on that x and y.

A reference to a tutorial or code example would be good.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

Here's one example.

If you're already using jQuery for something, here's another example.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 113 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.