Skip to content

eles.lock()

eles.lock — Collection > Grab, lock and pannability. Cytoscape.js signatures, parameters and return contract.

eles.lock — Collection › Grab, lock and pannability

Preview · Collection › Grab, lock and pannability

Read in the complete API reference · All API members

// Lock these elements against movement
eles.lock(): this

Lock these elements against movement. A node locked mid-tween holds where its position tween got to; the rest of the animation — other nodes, and this node's paint channels — runs on, and unlocking does not resume it.

Returns this

this collection, for chaining

Example

const node = cy.getElementById('a');
node.lock();
console.log(node.locked()); // true

Example graph and handle setup