Closed dcorb closed 8 years ago
In pages where there is no anchors: Uncaught TypeError: Cannot read property 'addEventListener' of null In Chrome I guess, it needs a if (link) or if (links) somewhere https://github.com/bendc/anchor-scroll/blob/master/scroll.js#L57
Uncaught TypeError: Cannot read property 'addEventListener' of null
Fixed in the meanwhile like this:
const elements = document.querySelectorAll("a.scroll") if (elements.length) { attachHandler(elements); }
Fixed, thanks!
That was fast! 👍
In pages where there is no anchors:
Uncaught TypeError: Cannot read property 'addEventListener' of null
In Chrome I guess, it needs a if (link) or if (links) somewhere https://github.com/bendc/anchor-scroll/blob/master/scroll.js#L57