Javascript Cheatsheet

Table of contents

Useful Snippets

To find element causing scroll

(Paste following into console and then scroll the element)

function findScroller(element) {  
    element.onscroll = function() { console.log(element)}  
    Array.from(element.children).forEach(findScroller);  
}  
  
findScroller(document.body);