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
| export const prevAll = element => { | |
| const prevElements = [] | |
| let prevElement = element.parentNode.firstElementChild | |
| while(prevElement !== element) { | |
| prevElements.push(prevElement) | |
| prevElement = prevElement.nextElementSibling | |
| } | |
| return prevElements |
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
| export const nextAll = element => { | |
| const nextElements = [] | |
| let nextElement = element | |
| while(nextElement.nextElementSibling) { | |
| nextElements.push(nextElement.nextElementSibling) | |
| nextElement = nextElement.nextElementSibling | |
| } | |
| return nextElements |
NewerOlder