CHANNELS:

All
E
EightBitRx posted 5 days ago

Hi,

This shouldn't be too hard. Here's the basic skeleton:

First include the necessary HTML in the same file as your canvas tag.

Like:

<div id="stuff" style="">Put your content here inside the div or whatever tag is appropriate</div>
<canvas id="canvas"></canvas>

then in your javascript simply add an event listener:

let stuffElement = document.querySelector('#stuff');
stuffElement.addEventListener('click', (event) => {
    // Place event related code here... use javascript to generate the HTML              
});

Alternatively, you could code all the HTML content in the HTML file and simply set the visibility on click.

Hope that helps!

Cheers :)

EightBitRx

Wow... just looked at the date and saw I'm 20 days late to the party... well, I'll post this anyhow.

0

Want to participate?

Create a free Chris Courses account to begin

or
Sign In

Providing the lift to launch your development career

© 2023 Chris Courses. All rights reserved.