CorvidReference

IconMouseInEvent

Event that is fired when a user hovers over a star on a ratings input component.

Table of Contents

PROPERTIES

?
Store values associated with an object.
labelGets the display label that corresponds to the icon that the mouse entered.
valueGets the value (1-5) that corresponds to the icon that the mouse entered.
contextGets the context of the event on a repeated element.
targetGets the element that the event was fired on.
typeGets the type of event that was fired.

MIXES IN

?
Where some functionality is inherited from.
$w.Event

label

Gets the display label that corresponds to the icon that the mouse entered.

Syntax

get label(): string
TYPE
?
The kind of data the property stores.
string

Examples

Get information about the icon that the mouse entered

$w("#myRatingsInput").onIconMouseIn( (event) => {
  let label = event.label;  // "Good"
  let value = event.value;  // 3
} );

value

Gets the value (1-5) that corresponds to the icon that the mouse entered.

Syntax

get value(): number
TYPE
?
The kind of data the property stores.
number

Examples

Get information about the icon that the mouse entered

$w("#myRatingsInput").onIconMouseIn( (event) => {
  let label = event.label;  // "Good"
  let value = event.value;  // 3
} );

context

Gets the context of the event on a repeated element.

Description

An event's context contains information about the circumstances surrounding the firing of the event. The context property only appears in events on repeated elements.

You can use the event context with $w.at() to get a selector function which selects items from a specific repeater item. It contains an object with one key:value pair. The key is "itemId" and the value is the ID of the repeated item on which the event occurred.

Syntax

get context(): EventContext

MIXED IN FROM

?
Where this functionality is inherited from.
$w.Event

Examples

Get the context of the event

// non-repeater event

$w("#myElement").onEvent( (event) => {
  let type = event.context.type; // "GLOBAL_SCOPE"
} );


// repeater event

$w("#myRepeatedElement").onEvent( (event) => {
  let $item = $w.at(event.context)
  $item("#anotherRepeatedElement").value = "new value";

  let itemId = event.context.itemId;  // "item1"
} );

target

Gets the element that the event was fired on.

Syntax

get target(): Element
TYPE
?
The kind of data the property stores.

MIXED IN FROM

?
Where this functionality is inherited from.
$w.Event

Examples

Get the ID of the target element

$w("#myElement").onEvent( (event) => {
  let targetId = event.target.id;  // "myElement"
} );

type

Gets the type of event that was fired.

Syntax

get type(): string
TYPE
?
The kind of data the property stores.
string

MIXED IN FROM

?
Where this functionality is inherited from.
$w.Event

Examples

Get the type of the event

$w("#myElement").onEvent( (event) => {
  let eventType = event.type; // "click"
} );