-
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.
- Loading branch information
Takatomo INOUE
committed
Feb 21, 2024
1 parent
79707b6
commit ccca456
Showing
6 changed files
with
125 additions
and
27 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
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,26 @@ | ||
const passages = document.getElementsByClassName("type-parallel") | ||
|
||
for (const passage of passages) { | ||
if (passage.tagName === "DETAILS") { | ||
passage.addEventListener("mouseover", function(e) { | ||
let idToCompare = e.target.id.slice(1) | ||
for (const p of passages) { | ||
if (p.tagName === "SPAN") { | ||
const id = p.getAttribute("id") | ||
if (idToCompare === id.split("g")[1]) { | ||
p.style.backgroundColor = "yellow" | ||
} | ||
} | ||
} | ||
} | ||
) | ||
} | ||
} | ||
for (const passage of passages) { | ||
passage.addEventListener("mouseout", function() { | ||
for (const p of passages) { | ||
p.style.backgroundColor = "transparent" | ||
} | ||
} | ||
) | ||
} |
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
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