simulate

Simulate a mouse event on the coordinates provided by an event's clientX and clientY coordinates. Additionally, debug can be enabled to see the cursor position.

Source:
Example
const event = { clientX: 500, clientY: 500 }; // sample event
$$$.simulate('click', event); // clicks the positions provided in the event
$$$.simulate('click', event, true); // enable cursor visual with `debug` set to `true`
Parameters:
Name Type Attributes Default Description
type string

The type of mouse event to simulate.

event object

A mouse event that is used for trigger an event.

Properties
Name Type Description
clientX object

The screen space x-coordinate.

clientY object

The screen space y-coordinate.

debug boolean <optional>
false

Allows to turn on the visuals for the event.

Returns:
  • Chainable api by returning the instance.
Type
self