Skip to content
Advertisement

Tag: expand

how to expand an image on click with JS?

I created a gallery using the following codepen and now I’m trying to add the function click to expand an image, using this JS method. Sadly I cannot get it to work. Any advice would be very helpful, either regarding this expand option or an alternative. Mind you I’m completely new to JS. Thanks in advance! Answer So after asking

collapsing/expanding compound node in cytoscape

Does cytoscape.js support collapsing/expanding compound node ? After collapsing A (+) or (-) sign to expand/collapse would be great. Looking for options to Group a set of nodes using Compound node and collapse/expand via user-interaction. If cytoscape.js doesn’t support this by-default, any alternatives/workarounds to reach the goal ? Answer It’s relatively straightforward using the API. Collapse: node1.descendants().addClass(‘collapsed-child’) Expand: node1.descendants().removeClass(‘collapsed-child’) …

Advertisement