Skip to content

Tag: html

Change image when another image is clicked

I am trying to change the big image when another small image is clicked, kind of like a product display on an e-commerce website. But my code doesn’t seem to work. Answer Don’t repeat JavsScript code. Instead delegate a click to every .button-container’s img element: Another suggestion is no…

Javascript event listeners and arrays

I am trying to recreate a scratch-to-reveal-image effect with 3 images in an array triggered by 3 buttons. My event listener is not working, as you can see, it shows the same revealed images no matter the button. The event listener syntax has confused me a bit and I would like some help on that specifically. …

traffic light sequence, html, javascript and css

I am trying to make a program that displays a traffic light sequence. I have made a mistake in the code so it doesn’t get past showing the red light when the “starts sequence” button is clicked. if you can see where I went wrong please help me get it working. I have used functions to change …

Use an image as a mask for another image

I’m making a website that I wanted to be a white page that you could stamp to make another image appear under. So when you click, you make a holepunch. Like this exemple : So I managed to have a randomized image in the background as I click which is fine for what I want, and to be able to

JavaScript Show invisible divs on click

I ran into a problem that when I click on the button, it just flips the icon but only makes the invisible fields visible on the second click. Are there any idea how to do it? (Heres a gif to show my problem: https://ibb.co/cvz7pWC ) Also heres my code : Answer This could be to do with you not being

How to remove getbutton.io branding

If we use this free getbuttton.io widget then it shows getbutton.io branding so, is there any way to remove that branding using JS? Answer it will take like 2 seconds to load. so you can do something like this. you can increase 2sec to 5 if it takes more time to load.