MDN self-hosted library · e01.org

VTTRegion: regionAnchorX property

WebVTT

Open notebook · 1 cells web-api-instance-property upstream source

WebVTT

The regionAnchorX property of the VTTRegion interface represents the x-coordinate of the region anchor, as a percentage of the region's width.

Value

A number, in the range 0 to 100 inclusive, representing the x-coordinate of the region anchor as a percentage of the region's width. The default is 0.

Exceptions

  • IndexSizeError DOMException
  • : Thrown when set to a value that is negative or greater than 100.

Examples

In the following example, a new VTTRegion is created, then the value of regionAnchorX is set to 30. The value is then printed to the console.

const region = new VTTRegion();
region.regionAnchorX = 30;
console.log(region.regionAnchorX);

Specifications

Browser compatibility