Chartbreaker
    Preparing search index...

    Interface ScreenOrientation

    The ScreenOrientation interface of the Screen Orientation API provides information about the current orientation of the document.

    MDN Reference

    interface ScreenOrientation {
        angle: number;
        onchange: null | ((this: ScreenOrientation, ev: Event) => any);
        type: OrientationType;
        addEventListener<K extends "change">(
            type: K,
            listener: (
                this: ScreenOrientation,
                ev: ScreenOrientationEventMap[K],
            ) => any,
            options?: boolean | AddEventListenerOptions,
        ): void;
        addEventListener(
            type: string,
            listener: EventListenerOrEventListenerObject,
            options?: boolean | AddEventListenerOptions,
        ): void;
        dispatchEvent(event: Event): boolean;
        removeEventListener<K extends "change">(
            type: K,
            listener: (
                this: ScreenOrientation,
                ev: ScreenOrientationEventMap[K],
            ) => any,
            options?: boolean | EventListenerOptions,
        ): void;
        removeEventListener(
            type: string,
            listener: EventListenerOrEventListenerObject,
            options?: boolean | EventListenerOptions,
        ): void;
        unlock(): void;
    }

    Hierarchy

    • EventTarget
      • ScreenOrientation
    Index

    Properties

    angle: number

    The angle read-only property of the angle.

    MDN Reference

    onchange: null | ((this: ScreenOrientation, ev: Event) => any)

    The type read-only property of the type, one of portrait-primary, portrait-secondary, landscape-primary, or landscape-secondary.

    MDN Reference

    Methods

    • The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.

      MDN Reference

      Parameters

      • event: Event

      Returns boolean

    • The unlock() method of the document from its default orientation.

      MDN Reference

      Returns void