100-project-100-days-website/100_projects/92-video-movie-popup/index.js
2023-05-24 12:23:47 +03:00
Ask

15 lines
464 B
JavaScript

{17c9771925f05443448abaf7cf4d76c48329f36a true 464 index.js 0xc0030d8d20}

const btnEl = document.querySelector(".btn");
const closeIconEl = document.querySelector(".close-icon");
const trailerContainerEl = document.querySelector(".trailer-container");
const videoEl = document.querySelector("video");
btnEl.addEventListener("click", () => {
trailerContainerEl.classList.remove("active");
});
closeIconEl.addEventListener("click", () => {
trailerContainerEl.classList.add("active");
videoEl.pause();
videoEl.currentTime = 0;
});