I am wondering how to cover a <div> with some useful HTML component/image to make the <div>:
- A) Unclickable (unreachable for mouse etc)
- B) Look a little ~0.3f blur (because of it transparent foreground)
- C) make the effect dynamic I mean make the
<div>covered/uncovered by some
event?
So my question is: What is the optimal way to make the previously mentioned effect with HTML, CSS, and Javascript?
(A) Making the div “Unclickable (unreachable for mouse etc)”
This can be accomplished by using the various CSS positioning elements to place two divs in the exact same location. Then to stack one div on top of the other, use
z-index(the element with the higherz-indexwill be stacked on top of the element with the lowerz-index). For example:HTML:
CSS:
(B) Making the div “Look a little ~0.3f blur (because of it transparent foreground)”
To do this, you would use CSS
opacity. For example:(C) “Make the effect dynamic I mean make the covered/uncovered by some event.”
You can accomplish this using Javascript. The simplest approach would probably be to use
document.getElementByIdto adddisplay:noneto the div you want to remove.NOTE: These are not the only ways to accomplish this task. I am just trying to give you a launching point. I recommend reviewing the MDN links I posted and writing code that works best for what you are specifically trying to accomplish.