forked from cytoscape/cytoscape.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Collection one
maxkfranz edited this page Mar 8, 2012
·
4 revisions
Add a callback function to be called one time when an event first occurs for each element.
Runs the specified callback function the next time the specified event occurs for each element
eventType A list of event types to bind to the elements.
function(eventObject) The callback function to be executed only the first time per element when the event occurs after binding.
This function triggers a specified callback function the first time each specified event occurs on each element.
If you want to have a callback function execute once per a collection, use col.once().
Print a message the first time n1 is clicked after binding:
cy.nodes("#n1").one("click", function(){
console.log("1st click of n1");
});