Created
October 11, 2017 19:43
-
-
Save wking-io/69f537844deb5cbff248cb5346fb00b0 to your computer and use it in GitHub Desktop.
How can I transform siblings of an element?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const transformSibs = (el, callback) => Array | |
| .from(el.parentNode.childNodes) | |
| .filter(child => child.nodeType == 1 && child != el) | |
| .forEach(sibling => { | |
| callback(sibling); | |
| return sibling; | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment