fix cleanup bug
This commit is contained in:
parent
fd9e2acc83
commit
de7dc499ee
28
index.js
28
index.js
@ -14,10 +14,12 @@ let words = [
|
||||
];
|
||||
|
||||
function makeSpaceWord(word){
|
||||
$("#lettersky").html("");
|
||||
$("#imagesky").html("");
|
||||
let length = word.length;
|
||||
for (var i = 0; i < length; i++) {
|
||||
$("#lettersky").append('<td><div ondrop="drop(event)" ondragover="allowDrop(event)" class="letterplace finalletterplace place"></td>');
|
||||
$("#imagesky").append('<td><div ondrop="drop(event)" ondragover="allowDrop(event)" class="imageplace finalimageplace place"></td>');
|
||||
$("#lettersky").append('<td><div ondrop="drop(event)" ondragover="allowDrop(event)" class="letterplace finalplace finalletterplace place"></td>');
|
||||
$("#imagesky").append('<td><div ondrop="drop(event)" ondragover="allowDrop(event)" class="imageplace finalplace finalimageplace place"></td>');
|
||||
}
|
||||
$("#lettersky").append('<td><div id="letterstatus" class="status"></div></td>');
|
||||
$("#imagesky").append('<td><div id="imagestatus" class="status"></div></td>');
|
||||
@ -26,16 +28,18 @@ function makeSpaceWord(word){
|
||||
let prefix = "assets/";
|
||||
|
||||
function cleanup(){
|
||||
var htmls = [];
|
||||
var returntos = [];
|
||||
$("[returnto]").each(function (index){
|
||||
htmls.push($(this).prop("outerHTML"));
|
||||
returntos.push($(this).attr("returnto"));
|
||||
$(this).remove();
|
||||
});
|
||||
for (var x = 0 ; x < returntos.length; x++) {
|
||||
//$('[returntarget="' + returntos[x] + '"]').html(htmls[x]);
|
||||
}
|
||||
// var htmls = [];
|
||||
// var returntos = [];
|
||||
// $("[returnto]").each(function (index){
|
||||
// htmls.push($(this).prop("outerHTML"));
|
||||
// returntos.push($(this).attr("returnto"));
|
||||
// $(this).remove();
|
||||
// });
|
||||
// for (var x = 0 ; x < returntos.length; x++) {
|
||||
// //$('[returntarget="' + returntos[x] + '"]').html(htmls[x]);
|
||||
// }
|
||||
|
||||
$(".finalplace").html("");
|
||||
}
|
||||
|
||||
function checkAnswers() {
|
||||
|
Loading…
Reference in New Issue
Block a user