Skip to content

Instantly share code, notes, and snippets.

@diego3g
Created March 22, 2018 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diego3g/8470f840328a3a2017ba222ca1fe998c to your computer and use it in GitHub Desktop.
Save diego3g/8470f840328a3a2017ba222ca1fe998c to your computer and use it in GitHub Desktop.
function onResize(event) {
var node = document.createElement("p");
var textnode = document.createTextNode(event.target.outerWidth + "x" + event.target.outerHeight);
node.appendChild(textnode);
document.getElementById('content').appendChild(node);
}
window.onresize = _.throttle(onResize, 500);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment