방금 작은 if, else if 루프를 작성했습니다. 콘솔에 unexpected token ';'
오류가 표시됩니다. 각 $(this).css('top', top-3"em");
진술 후 ;
을 제거하면 else if
이 예기치 않게 발생하기 전에 }
이라는 또 다른 오류가 발생합니다.if else if loop broken
여기 내 루프가 있습니다. 내가 빗나 갔을지도 모르는 아이디어가 있습니까?
$('div.result').each(function() {
$(this).css('top', top+"em");
top = top + 8;
resultcount = resultcount - 1;
if(resultcount=5) {
$(this).css('top', top-3"em");
} else if(resultcount=4) {
$(this).css('top', top-7"em");
} else if(resultcount=3) {
$(this).css('top', top-14"em");
} else if(resultcount=2) {
$(this).css('top', top-20"em");
} else(resultcount=1) {
$(this).css('top', top-30"em");
}
});
유효하지 않은 비교에서 문자열 통합이 없음까지 일련의 구문 오류가 있습니다. – adeneo
@ Borsel 당신은 ** If, else if loop broken **;)이라는 링크를 클릭 한 사람이기도합니다. –