Three.js not rendering correctly when canvas has display: none

It would help you get better answers if you put your code in a jsfiddle or similar so that people don’t have to do it for you.