在 jqPuzzle 的设置中,我可以传递当人完成拼图时将调用的成功函数。问题是我的页面上有几个谜题,我想对当前完成的谜题进行操作,但结果只有几秒钟和移动次数。如何获得当前已完成的拼图?
这是我谈论的演示:http: //polishwords.com.pl/dev/puzzle/exa.php
重要的部分是:
function initializePuzzle()
{
var settings = {
cols: 3,
rows: 3,
success: {
callback: function(results) {
//results.moves and results.seconds, but how to get the puzzle that was completed?
alert(results.moves);
var puzzleThatWasCompleted = ???;
}
}
};
$('.puzzle').jqPuzzle(settings); //Changing all images of class puzzle to puzzles
}