커피 스크립트에서 하나의 등호 while 루프 : 여기마 내가 커피 스크립트에 다음 JS를 코딩하기 위해 노력하고있어
x = 0;
if(node.offsetParent) {
do {
x += node.offsetLeft;
} while(node = node.offsetParent);
}
내가 지금까지 가지고 있지만, 노드가 다시 널 올 것으로 보인다 무엇
if node.offsetParent
loop
x += node.offsetLeft
break if typeof (node = node.offsetParent) == "undefined"
x
코드가 올바르게 보입니다. – thejh
죄송합니다. 노드 변수가 null로 되돌아 갔어야합니다. – agmcleod
오른쪽. 왜 안돼? – thejh