Cytoscape.js Check for double Click on nodes -


i have question. there possibility bind double click mouse event node?
in documentation, there 'click'.

thanks help!

you can add custom doubletap event cytoscape this:

var cy = $('#cy').cytoscape('get'); var tappedbefore; var tappedtimeout; cy.on('tap', function(event) {   var tappednow = event.cytarget;   if (tappedtimeout && tappedbefore) {     cleartimeout(tappedtimeout);   }   if(tappedbefore === tappednow) {     tappednow.trigger('doubletap');     tappedbefore = null;   } else {     tappedtimeout = settimeout(function(){ tappedbefore = null; }, 300);     tappedbefore = tappednow;   } }); 

then, can subscribe new event. example, if need detect double tab on nodes, do:

cy.on('doubletap', 'node', function(event) { /* ... */ }); 

nevertheless, understant @maxkfranz point of view not mobile-friendly solution.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -