Put window.onresize() inside onload