PageRevealEvent: PageRevealEvent() constructor

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The PageRevealEvent() constructor creates a new PageRevealEvent object instance.

Syntax

js
new PageRevealEvent(type, init)

Parameters

type

A string representing the type of event. In the case of PageRevealEvent this is always pagereveal.

init

An object containing the following properties:

viewTransition Optional

A ViewTransition object representing the active view transition for the related navigation. Defaults to null if there is no active view transition.

Examples

A developer would not use this constructor manually. A new PageRevealEvent object is constructed when a handler is invoked as a result of the pagereveal event firing.

Specifications

Specification
HTML
# the-pagerevealevent-interface

Browser compatibility

desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
PageRevealEvent() constructor

See also