Edit this page

up.layer up:layer:opened
DOM event

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

Opening overlays

Customizing the overlay appearance

The event is emitted right before the opening animation starts. Because the overlay has not yet been painted 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!')
  }
})

See Customizing overlays for other methods to change the overlay appearance.


Event properties

event.origin
required

The link element that is opening the overlay.

event.layer
required

The layer object that is opening.