Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 27 additions & 8 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,34 @@ $(document).ready(function() {
element.addEventListener("click", toggleCard);
});

// Display a hint (type ie tv, movie or musical) when hovering over the question mark.
$("#emojis").on("mouseover", ".hint-container", function () {
$(this).find(".hint").addClass("hint-reveal");
});
// // Display a hint (type ie tv, movie or musical) when hovering over the question mark.
// $("#emojis").on("mouseover", ".hint-container", function () {
// $(this).find(".hint").addClass("hint-reveal");
// });

// // Hide hint (type ie tv, movie or musical) when the user stops hovering over the question mark.
// $("#emojis").on("mouseleave", ".hint-container", function () {
// $(this).find(".hint").removeClass("hint-reveal");
// });

// Get the element that triggers the hover event
const emojisContainer = document.getElementById("emojis");

// Add a mouseover event listener
emojisContainer.addEventListener("mouseover", function (event) {
if (event.target.classList.contains("hint-container")) {
const hint = event.target.querySelector(".hint");
hint.classList.add("hint-reveal");
}
});

// Hide hint (type ie tv, movie or musical) when the user stops hovering over the question mark.
$("#emojis").on("mouseleave", ".hint-container", function () {
$(this).find(".hint").removeClass("hint-reveal");
});
// Add a mouseleave event listener
emojisContainer.addEventListener("mouseleave", function (event) {
if (event.target.classList.contains("hint-container")) {
const hint = event.target.querySelector(".hint");
hint.classList.remove("hint-reveal");
}
});

// Toggle to expand or hide all of the movie/show names by clicking an icon
$(".btn-reveal-all").click(function () {
Expand Down