Home > Enterprise >  How to make a button so that when you click on it, a block with a darkened photo pops up
How to make a button so that when you click on it, a block with a darkened photo pops up

Time:02-06

How to make a button so that when you click on it, a block with a darkened photo pops up

CodePudding user response:

to do something like this, I would create the darkened photo first with hidden display. After clicking the button make display visible.

CodePudding user response:

Use a <dialog> element containing the darkened photo. Attach an event handler to the button that when clicked opens the modal using HTMLDialogElement.showModal() method.

  • Related