150
rated 0 times
[
151]
[
1]
/ answers: 1 / hits: 17999
/ 10 Years ago, thu, april 17, 2014, 12:00:00
I don't know why this doesn't work:
window.addEventListener('load', setSize(), false);
window.addEventListener('resize', setSize(), false);
function setSize(){
width = window.innerWidth;
console.log(width);
}
It logs the width right after load, but it doesn't do that when I resize.
More From » html