Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The beforetoggle
event of the HTMLElement
interface fires on a popover element (i.e. one that has a valid popover
attribute) just before it is shown or hidden.
- If the popover is transitioning from hidden to showing, the
event.oldState
property will be set toclosed
and theevent.newState
property will be set toopen
. - If the popover is transitioning from showing to hidden, then
event.oldState
will beopen
andevent.newState
will beclosed
.