Hover Script

Hover Script is a behavior in the Interactions category. It lets you attach two pieces of JavaScript to a shape: one runs when the pointer enters the shape, the other when the pointer leaves. Use it for lightweight visual feedback such as hover highlighting, temporary hints, or emphasizing the device the user is pointing at. Like Click Script, it only runs in the exported HQ VISU page when the user actually interacts with the mouse; it does not fire while you edit the slide in PowerPoint. Note there is no automatic revert: whatever you change on enter, you must change back on leave.

Interactions

Interactions: Hover Script

Bind JavaScript that runs on mouse over and mouse out of a shape: Pointer Enter for highlight/hint effects, Pointer Leave to restore. Runs only on real pointer interaction in the exported page.

What it is and what it is for

Hover Script is a behavior in the Interactions category. It lets you attach two pieces of JavaScript to a shape: one runs when the pointer enters the shape, the other when the pointer leaves. Use it for lightweight visual feedback such as hover highlighting, temporary hints, or emphasizing the device the user is pointing at. Like Click Script, it only runs in the exported HQ VISU page when the user actually interacts with the mouse; it does not fire while you edit the slide in PowerPoint. Note there is no automatic revert: whatever you change on enter, you must change back on leave.

How to use it: the fields in its editor

Select the shape and open the Hover Script behavior editor. The Trigger is fixed and shows Pointer Move. The editor has two script boxes, both full script-body slots (multi-line logic, ReadTag*/WriteTag*, and async APIs like setTimeout/fetch are allowed):

  • Pointer Enter (mouse over; called Mouse Over in the docs): script that runs when the pointer enters the shape.
  • Pointer Leave (mouse out; called Mouse Out in the docs): script that runs when the pointer leaves, used to undo what the enter script changed.
  • Context objects available in the script: object, objects, event (mouse context) plus tag, page, presentation, shape, qtedit, globals, escript.
  • object is the current shape's DOM element, so you can set its style directly (e.g. object.style.opacity); shape.name is the shape name.
  • Note: Hover Script has no Enable/Condition gate (unlike Click Script); both scripts simply run.
// Pointer Enter (mouse over)
object.style.opacity = "0.7";

// Pointer Leave (mouse out)
object.style.opacity = "1";

When to use it

Best for purely presentational mouse feedback that hints to the user without requiring a click.

  • Device-icon hover highlight: dim the opacity or add a stroke when the pointer is over a pump/valve, restore on leave, to signal it is clickable.
  • Temporary info hint: on enter use qtedit to show a note or emphasis border on the page, clear it on leave, without interrupting the operator.

Boundaries and common mistakes

A few things that genuinely trip people up:

  • Enter changes are not auto-undone: you must write the matching restore logic in Pointer Leave, or the effect stays after the pointer leaves.
  • It runs only on real pointer interaction in the exported/host page, not in PowerPoint edit mode, so verify after export.
  • If you write a tag (WriteTag*) on hover, the write still goes through the host's permission/confirm/async path; do not assume call-means-success or that it is synchronous. Keep hover for visual feedback and avoid high-frequency writes.
Hover Script behavior editor
Figure 1: Hover Script editor

Fill the Pointer Enter and Pointer Leave scripts separately; the leave script restores what the enter script changed.