A question about the overlay of the Modal Window Project

This issue has been tracked since 2022-08-19.

" when we want to click the outside of a modal ,then the modal window closes . "I finished this by following teacher jonas .But i am confused about why we can do that ? the overlay is a empty div ,so why clicking the outside of a modal equals to clicking the empty div container.

bobweein wrote this answer on 2022-08-19

I mean why i clicked the outside of a modal ,i clicked the overlay div . because the overlay div is empty ? what is the edge of this overlay div?

velinnakov wrote this answer on 2022-08-24

Overlay div has width and height 100% and class 'hidden' is removed from it too when modal is open. That's why wherever you click outside of the modal window you actually click on that overlay div. Click event on modal itself is not counted as click on overlay div because of the z-index property in css. Hope it helps.

bobweein wrote this answer on 2022-09-04

Overlay div has width and height 100% and class 'hidden' is removed from it too when modal is open. That's why wherever you click outside of the modal window you actually click on that overlay div. Click event on modal itself is not counted as click on overlay div because of the z-index property in css. Hope it helps.

Get it ,Thank you for helping !!!!!

More Details About Repo
Owner Name jonasschmedtmann
Repo Name complete-javascript-course
Full Name jonasschmedtmann/complete-javascript-course
Language JavaScript
Created Date 2018-06-14
Updated Date 2023-03-29
Star Count 12137
Watcher Count 850
Fork Count 14403
Issue Count 153

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date