2012-01-07 2 views

답변

3

: $(node).offset() 다음 .top

10

.left jQuery를하지 않고 대답을 제공하려면 :

var a = Element, b = 0, c = 0; 
while (a) { 
    b += a.offsetLeft; 
    c += a.offsetTop; 
    a = a.offsetParent; 
} 

Element이 요소 노드

있는 당신은 offsetLeftoffsetTop이 필요합니다.

+3

+1은 jQuery를 사용하지 않습니다. –

관련 문제