Closed thomasverleye closed 2 years ago
if (document.getElementsByClassName('js-game-container').length > 0) {
//move the canvas element inside the game container
document.getElementsByClassName('js-game-container')[0].appendChild(g.canvas)
}
This did the trick for me :-)
@thomasverleye Thank you for posting this! This indeed is a feature I need to add to Hexi - I had the same problem a few weeks ago on one of my own projects! Glad you found a workaround 😄
Is there any way to add the canvas element in a specific div? Hexi creates the div directly inside the body but I'd need to put this elsewhere because of styling reasons.