tags:

views:

38

answers:

4

how can i get the div's current postion with jquery or divs current placement with jquery

+1  A: 

Check out the "CSS" section of the jQuery docs, in particular the #offset function.

T.J. Crowder
+1  A: 
var position = jQuery('#myelement').position();
alert(position.left);
alert(position.top);
J-P
`#position` gives the position relative to the offset parent. The OP didn't exactly give us much to work with, but I'm guessing he needs relative to the doc (`#offset`). And yes, those names seem backward to me. :-)
T.J. Crowder
A: 

Do you mean position on your web page? This depends on the browser you are using. They handle code in a different way sometomes...

You can check your app via Firebug in Firefox or Webdeveloper Toolbar in Internet Explorer for getting the right values.

bastianneu
A: 

try position function.

var pos=$("#ID_OF_DIV").position();

alert("TOP: " + pos.top +"\r\nLEFT: " + pos.left);
TheVillageIdiot