![]() ![]() = function() else if (document.getElementById("minutes"). GameEndMessage = document.getElementById("game-end-message") ![]() GameEndTitle = document.getElementById("game-end-title") GameEndInner = document.getElementById("game-end_inner") GameEndContainer = document.getElementById("game-end-container") GameStartContainer = document.getElementById("game-start-container") TimerSeconds = document.getElementById("seconds") ĪllCards = document.getElementsB圜lassName("card") TimerMinutes = document.getElementById("minutes") GameBoard = document.getElementById("game-board") Therefore, what alternatives do I have to ensure that the user can’t click on the card elements while they’re being compared/viewed?īelow is the JS I have so far… //document.getElementById("start-game").onclick(startGame()) The idea initially was that “pointer-events” would be set to “none” on the elements being checked, and then “pointer-events” was set to “auto” if it was found the cards didn’t match. I’ve found that I can use the style “pointer-events” but this isn’t supported in Safari or IE. ![]() There is a deliberate delay in the “matching” so that the user can see that they have indeed matched or not. So I’ve been putting together a simple memory card game and want to ensure the user can’t click on the cards being matched while they’re being checked. Im trying to periodically run a calculation (every 5 seconds) and update a components state with the calculated value using a setInterval timer. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |