" 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.
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.
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 !!!!!
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 |
Issue Title | Created Date | Updated Date |
---|