我會嘗試讓代碼在這裏說明自己:如果條件可以用來檢查當前代碼之後是否會有另一個迭代?檢測是否有下一個,而在每個循環中
$('#%id% td').each(function(){
if(??????????){ // if there will be a next iteration
while($(this).height() == thisheight){
// do something here on this iteration, but only if there will be another.
}
}
});
如果這是'each'循環的整個內容,可以通過選擇器輕鬆解決。 –