I want to add this sliding door code.
How it would work:
After the play svg image is clicked, it would disappear, and the sliding doors would open to reveal what is behind them.
Sliding Door code by itself.
code: https://jsfiddle.net/eqrutdo8/
Most of the javascript removed so it is easier to work on the code.
Sliding Door
Added to
code: https://jsfiddle.net/jk9syn5h/
Removed from
code: https://jsfiddle.net/gmo8r6j5/1/
To implement this, I would be adding a new function here right?
Something similar to this?
Also, I believe I would be removing hover, and adding a ClickHandler in place of that, if I am correct about that.
(function iife() {
"use strict";
function show(el) {
el.classList.remove("hide");
}
function hide(el) {
el.classList.add("hide");
}
function coverClickHandler(evt) {
const cover = evt.currentTarget;
const thewrap = cover.parentNode.querySelector(".container");
hide(cover);
show(thewrap);
}
const cover = document.querySelector(".jacketa");
cover.addEventListener("click", coverClickHandler);
}());