Control.setIsHovered

Syntax

setIsHovered(value: Boolean);

Parameters

value. Indicates whether a component is displayed only on mouseover.

Description

The setIsHovered method sets up component displaying only on mouseover.

Comments

Available values of the value parameter:

Example

To execute the example, connect the PP.js library and the PP.css visual styles table. Create a button, and show it as on hover. Apply 50% transparency for the button:

  b1 = new PP.Ui.Button({
    ParentNode: document.body,
    Content: "Button"
  });
  //Toggle the button to the Hovered state
  b1.setIsHovered(true);
  //Apply transparency
  b1.setOpacity(0.5);

After the example execution a button that looks as follows is placed in the page:

Remove style for the Hovered state:

b1.removeStateClasses();

The button will look like follows:

See also:

Control