帮我完善这个拼图游戏的js代码直接给出代码不需要解释var aDivID = null;var aDivClass = null; var Flag = 0;function change aDiv alertaDiv; if!Flag aDivID = aDiv; aDivClass = documentgetElementByIdaDivclassName; Flag = 1; els
var aDivID = null; var aDivClass = null; var Flag = 0;
function change(aDiv) { if (!Flag) { aDivID = aDiv; aDivClass = document.getElementById(aDiv).className; Flag = 1; } else if (document.getElementById(aDiv).className == "spacediv") { document.getElementById(aDiv).className = aDivClass; document.getElementById(aDivID).className = "spacediv"; aDivID = null; aDivClass = null; Flag = 0; } else { aDivID = null; aDivClass = null; Flag = 0; } }
原文地址: https://www.cveoy.top/t/topic/JVF 著作权归作者所有。请勿转载和采集!