pointer-events

The pointer-events CSS property specifies under what circumstances a given element can be the target element for a pointer event.

Syntax

CSS

pointer-events: value;

JS

object.style.pointerEvents = "value";

Values

<'pointer-events'> = bounding-box | visiblePainted | visibleFill | visibleStroke | visible | painted | fill | stroke | all | none
bounding-box

The given element must be a target element for pointer events when the pointer is over the bounding box of the element.

visiblePainted

The given element can be the target element for pointer events when the visibility property is set to visible and when the pointer is over a "painted" area. The pointer is over a painted area if it is over the interior (i.e., fill) of the element and the fill property has an actual value other than none or it is over the perimeter (i.e., stroke) of the element and the stroke property is set to a value other than none.

visibleFill

The given element can be the target element for pointer events when the visibility property is set to visible and when the pointer is over the interior (i.e., fill) of the element. The value of the fill property does not affect event processing.

visibleStroke

The given element can be the target element for pointer events when the visibility property is set to visible and when the pointer is over the perimeter (i.e., stroke) of the element. The value of the stroke property does not affect event processing.

visible

The given element can be the target element for pointer events when the visibility property is set to visible and the pointer is over either the interior (i.e., fill) or the perimeter (i.e., stroke) of the element. The values of the fill and stroke do not affect event processing.

painted

The given element can be the target element for pointer events when the pointer is over a "painted" area. The pointer is over a painted area if it is over the interior (i.e., fill) of the element and the fill property has an actual value other than none or it is over the perimeter (i.e., stroke) of the element and the stroke property has an actual value other than none. The value of the visibility property does not affect event processing.

fill

The given element can be the target element for pointer events when the pointer is over the interior (i.e., fill) of the element. The values of the fill and visibility properties do not affect event processing.

stroke

The given element can be the target element for pointer events when the pointer is over the perimeter (i.e., stroke) of the element. The values of the stroke and visibility properties do not affect event processing.

all

The given element can be the target element for pointer events whenever the pointer is over either the interior (i.e., fill) or the perimeter (i.e., stroke) of the element. The values of the fill, stroke and visibility properties do not affect event processing.

none

The given element does not receive pointer events.

Initial

visiblePainted

Examples

all

bounding-box

fill

none

painted

stroke

visible

visibleFill

visiblePainted

visibleStroke

JS

JS

World Wide Web Consortium (W3C)

Home Menu