これは、私が開発しようとしているパズル ゲームのスニペットです。each()
問題は、jquery が呼び出された後に動作が停止することです。問題を解決するのを手伝ってください。前もって感謝します。
function setTotalInPositionPieces()
{
$("#board").children('div').each(function(index, element) {
if(testInPosition(element))
{
++totalInPositionPieces;
$(element).attr("data-inPositionStatus", '1');
}
});
/* The script does not from here, onward. Please tell
me what is the problem.*/
if(totalInPositionPieces == totalPieces)
{
$("#messageBox").text("Puzzle Solved!");
}
}
totalInPositionPieces
およびtotalPieces
グローバル変数です。