A web developer's blog. PHP, MySQL, CakePHP, Zend Framework, Wordpress, Code Igniter, Django, Python, CSS, Javascript, jQuery, Knockout.js, and other web development topics.

jQuery: Find position the exact position of an element in the browser window

I used this to display a dynamically created Div beside the clicked element.

var pos = $('#button_id').position();
alert("POSITION: nLeft: "+pos.left + "nTop: " + pos.top);
This entry was posted in Uncategorized. Bookmark the permalink.

5 Responses to jQuery: Find position the exact position of an element in the browser window

  1. dudeguy says:

    It’s ok to have a comment.

  2. Jai says:

    Cool! Thanks for the tip!

  3. BogusRed says:

    Thanks for this. needed it to create a drop down menu in a fixed width centered layout. came in handy!

  4. azadious says:

    Reference of another element.

    Non-window browser.

  5. test says:

    thnaks gud Solution really helpfu

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>