Created
June 9, 2019 12:38
-
-
Save sr9yar/cd4ed1c3960d1959116363b17d3aabdd to your computer and use it in GitHub Desktop.
Browser window resize event listener
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
function handleResize() { | |
const heights = {}; | |
heights.window = window.innerHeight; | |
const [contactsTable] = document.getElementsByClassName('contacts-table'); | |
if (contactsTable) { | |
heights.contactsTable = contactsTable.offsetHeight; | |
} | |
console.log(heights); | |
} | |
window.addEventListener('resize', handleResize); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment