3 ms·
Show HN: Generates relations between DOM elements depending on their depth
- kburman 6y agoWhat is the usecase for this?
- jimmy2020 6y agoThis is the fastest way you can traverse in DOM tree especially if you have an app that heavily depends on manipulating dom nodes. Let's say for animation, you targeted the clicked element with transition and apply internally some logic to the dom tree elements before they got effected with this transition. In this case, stored relations really shines. Think of it when the user doesn't click once or twice, but actually hundreds of times. That wouldn't be a problem if you know what DOM is look like. And that's not applied to a known app you design. This is an algorithm, that simply designed to deal with any tree even frameworks that generate DOM Asynciously From parents to children and vice-versa.
- spiralx 6y agoI'm impressed. I've looked through the README, the code, the tests and your comments here, yet I have no idea what this is supposed to do, how it relates to the DOM, how you would use it or why you would use it.