-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create tables with boxes; init positioning
- Loading branch information
1 parent
2b1160e
commit 81b0e02
Showing
3 changed files
with
80 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const ids = ["a1", "a2", "a3", "b1", "b2", "b3", "c1", "c2", "c3"]; | ||
|
||
document.onclick = function (event) { | ||
|
||
const { target } = event; | ||
const { id } = target; | ||
|
||
if (ids.includes(id)) { | ||
const box = document.getElementById(id); | ||
box.classList.add('clicked'); | ||
box.classList.remove('unclicked'); | ||
document.addEventListener('click', function() { | ||
box.classList.add('unclicked'); | ||
box.classList.remove('clicked'); | ||
}, true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters