adding and removing elements
See original GitHub issueWhat is the best way to add/remove elements dynamically? Consider a program like GNU Screen, where you want to dynamically add and remove sub-windows.
Is there any way to add a new element, except by calling destroy
and then creating a new Split object? It would seem this could cause minor flicker or jumps.
I can see at least 3 useful add “modes” for adding an element at position i:
- Initialize the sizes to all elements have the same size. That cause non-neighbor elements to “jump” so you probably wouldn’t want that.
- Split the “current” (either i or i-1) element into 2 equal halves.
- Split the neighboring elements i-1 and i into thirds.
To delete an element there is collapse
, but that doesn’t seem to be what we’re looping for.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Top Results From Across the Web
adding and deleting elements - WebPlatform.org
Adding and Deleting Elements ; createElement(), Used to create an element ; removeChild(), Remove the selected element or child node. ; appendChild(), Add...
Read more >How to add or delete HTML Elements through JavaScript
To add an HTML element in your JavaScript program, you can use the appendChild() and insertBefore() method, whereas, for deleting any specific HTML...
Read more >Adding and Removing HTML Elements
In the last course section we learned two ways to add and remove content from our webpages: Use inline styles to show and...
Read more >How to add and remove elements from DOM in JavaScript?
Removing an element is fairly easy, we can use the removeChild() method available in the div tag and pass the reference of our...
Read more >Element.remove() - Web APIs - MDN Web Docs
The Element.remove() method removes the element from the DOM. Syntax. remove()
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
My ideal would be a general package for managing panes, that would support:
Toolkits that I’ve used that support all of these include the Atom editor and the NetBeans IDE. It would be great to be able to do it with portable JavaScript.
I’ve been thinking about how to add these features to DomTerm, though for now I’m seeing whether I can get Atom to do what I want. That has its own challenges.
I like the simplicity of this library, I believe it has big potential. Do you plan to extend API with mentioned add()/remove() commands or similar? My +1 for this.