Edit this page

up.layer up:layer:opened
DOM event

This event is emitted after a new overlay was placed into the DOM.

The event is emitted right before the opening animation starts. Because the overlay has not been rendered by the browser, this makes it a good occasion to customize overlay elements:

up.on('up:layer:opened', function(event) {
  if (isChristmas()) {
    up.element.affix(event.layer.element, '.santa-hat', text: 'Merry Christmas!')
  }
})

Event properties

event.origin Element

The link element that is opening the overlay.

event.layer up.Layer

The layer object that is opening.