Hey I took the liberty to make a new version for the script including the following features:
- no more jQuery dependency 馃帀
- possibility to have several different modals on the page
- DOM API for openers (
data-show-modal="modal-id") / closers (data-hide-modal)
- JS API to manually show and hide the modal (
modal.show(), modal.hide())
- JS API to know whether it鈥檚 hidden or shown (
modal.shown)
- Addition of
[tabindex]:not([value="-1"]) to focusable elements
- Cleaner code
Find the code here: https://github.com/edenspiekermann/accessible-modal-dialog.
Find a demo here: http://codepen.io/HugoGiraudel/pen/jWQqeq?editors=0100.
Would you like me to submit a PR?
Hey I took the liberty to make a new version for the script including the following features:
data-show-modal="modal-id") / closers (data-hide-modal)modal.show(),modal.hide())modal.shown)[tabindex]:not([value="-1"])to focusable elementsFind the code here: https://github.com/edenspiekermann/accessible-modal-dialog.
Find a demo here: http://codepen.io/HugoGiraudel/pen/jWQqeq?editors=0100.
Would you like me to submit a PR?