Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to get element position in jquery

.offset() will return the offset position of an element as a simple object, eg:

var position = $(element).offset(); // position = { left: 42, top: 567 }
You can use this return value to position other elements at the same spot:

$(anotherElement).css(position)
 
PREVIOUS NEXT
Tagged: #element #position #jquery
ADD COMMENT
Topic
Name
7+2 =