- Usually a modal.
- Is an HTML element
- NOT always added to the top layer.
- Has a visible overlay.
- Has a return value
- Needs a close button/script to close the dialog
open
include this if you want it open as soon as the page loads / dialog is added to the DOM and page.
open
a boolean representing the current state of the dialogreturnValue
when dialogs close they return a value from the function
dialog.show(); //you can still interact with elements on the page
dialog.showModal(); //you cannot interact with elements on the page (Modal) **
dialog.close(returnVal);
dialog.addEventListener("close", func)
- when the close method is called,dialog.addEventListener("cancel", func)
- when the user clicks ESC
- Always added to the top layer.
- popover has no overlay?
- Has light dismiss
- Is an API. Not an actual html element.
- Can technically use any element but is usually a or
For button or input element.
popovertarget
the id of the element which will be the popover to displaypopovertargetaction
"hide", "show" or "toggle" : what clicking the button will do
For the element that will be the popover
popover
can be set to "manual" or "auto"
buttonElement.popoverTargetElement; //which popover is controlled by the button
buttonElement.popoverTargetAction; //what to do with the popover when clicked
popover.addEventListener("toggle", func)
after the popover is hidden or shownpopover.addEventListener("beforetoggle", func)
just before the popover visibility changes
popoverElement.togglePopover();
popoverElement.hidePopover();
popoverElement.showPopover();
// See the main.css file for the default CSS properties and values