Skip to content

API reference

cy.tapholdDuration — Core > Interaction controls. Cytoscape.js signatures, parameters and return contract.

cy.tapholdDuration — Core › Interaction controls

Preview · Core › Interaction controls

Read in the complete API reference · All API members

#cy.tapholdDuration()

// Unmoved-press duration before 'taphold' fires, ms (default 500)
cy.tapholdDuration(): number

Unmoved-press duration before 'taphold' fires, ms (default 500).

Returns number

the current tapholdDuration value

Example

console.log(cy.tapholdDuration()); // 500

Example graph and handle setup

#cy.tapholdDuration(ms)

// Unmoved-press duration before 'taphold' fires, ms (default 500)
cy.tapholdDuration(ms: number): this

Unmoved-press duration before 'taphold' fires, ms (default 500).

Parameters
NameDescription
ms: number

the new duration

Returns this

this core, for chaining

Example

const result = cy.tapholdDuration(500);
console.log(result === cy); // true

Example graph and handle setup

Throws

if ms is not a finite non-negative number