javascript - Slide in absolute positioned Modal -
i've created background div hosts modal div.
i have set modal div have css:
.modal { opacity: 0.01; top: 20px; transition: ease-in 200ms; }
then created class add in order show it
.modal-open { top: 50px; opacity: 1; }
however, when open class added div, chrome shows properties being striked out (a.k.a not taking effect or overridden).
see codepen demonstration. can click on background hide modal again.
why isn't transitioning properly?
because placed .model-open before .modal in css.
.modal { position: absolute; z-index: 101; transition: 300ms ease-in-out; top: 20px; opacity: 0.01; width: 500px; background-color: white; left: 50%; margin-left: -250px; } .modal-open { top: 50px; opacity: 1; }
Comments
Post a Comment