Optional
dataEvery entry in this object will be set as a data attribute on the new overlay.
Keys can be either kebab-case or camelCase (they will be converted if needed). Do not include the "data-" prefix which will be added automatically. E.g. both "foo-bar" and "fooBar" will result in "data-foo-bar" being set.
Optional
idIf set, then it will be assigned as the DOM element ID for the new overlay.
Furthermore, the new overlay will be created and will not be saved for future reuse.
By default, if id
is not given, the overlay will be saved, and if
createOverlay is called again with the same style
, data
and
parent, the previous overlay is returned.
Optional
parentThe parent element to insert the overlay into.
If not given, then:
position: fixed
, then document.body
is usedOptional
styleEvery entry in this object will be set on the style
of the new overlay.
IMPORTANT: By default overlays are positioned absolutely, so if you need
another positioning, override this here by setting a position
key in
style
. If position is either "absolute" (by default or explicitly set) or
"fixed", and none of top
or bottom
is given, top: 0
is set; and
similarly, if none of left
or right
is given, left: 0
is set.