I really like the way Internet Explorer 6 renders my website. No gradients, no background image, no SVGs, no columns… That would be excellent for small devices, right?
Anyway, in one part of the game, you should click on a row in a "table" (tablica) made out of divs (tablica[i][j]) to swap the cells in that row (to put the content of the cell in the correct column). Here is the relevant piece of code:
When the user clicks on a row in that table, the cells in that row are swapped, and the content of the table is correctly tracked in the string arrays "odgovor1" and "odgovor2". However, they are swapped without any animation, they are swapped immediately. When I try to apply JQuery animations to the cells (divs) "tablica[1][j]" and "tablica[2][j]" (by inserting them into the "eval"), the program crashes. Do you know how to do that properly?
Here is a screenshot if it helps: https://postimg.org/image/t6cofk4f1/
If you have some ideas for the interfaces of the Part #2 and Part #3 of the game that are easy to program, please tell me about them.
Anyway, in one part of the game, you should click on a row in a "table" (tablica) made out of divs (tablica[i][j]) to swap the cells in that row (to put the content of the cell in the correct column). Here is the relevant piece of code:
Code:
for (var j=0; j<odgovor1.length; j++)
for (var i=1; i<3; i++)
{
tablica[i][j]=document.createElement("div");
tablica[i][j].setAttribute("class","rijecUDrugomDijelu");
if (i===1) tablica[i][j].appendChild(document.createTextNode(odgovor1[j]));
else if (i===2) tablica[i][j].appendChild(document.createTextNode(odgovor2[j]));
tablica[i][j].style.top=228+27*j;
tablica[i][j].style.left=-153+110+153*i;
tablica[i][j].onclick=eval(
"(function()"+
"{"+
"var tmp=tablica[1]["+j+"].style.left;"+
"tablica[1]["+j+"].style.left=tablica[2]["+j+"].style.left;"+
"tablica[2]["+j+"].style.left=tmp;"+
"tmp=odgovor1["+j+"];"+
"odgovor1["+j+"]=odgovor2["+j+"];"+
"odgovor2["+j+"]=tmp;"+
"})"
);
pozadina.appendChild(tablica[i][j]);
}
Here is a screenshot if it helps: https://postimg.org/image/t6cofk4f1/
If you have some ideas for the interfaces of the Part #2 and Part #3 of the game that are easy to program, please tell me about them.