I've got a bunch of images, on click I want the images to turn white emulating some kind of fade effect. So you click it and for 1 second it fades from the original image to just white. I also need it to turn back to the original image when the user clicks something else.
Is this possible with JavaScript? - If so what should I be looking at (I'm really bad with graphics).
I've had a go at trying this with opacity but I don't want the background to be visible behind the image
srcchange to a base white image. Overlaying elements would be cumbersome and unnecessary.::afterpseudo-element overlays a white block (which is only white when classactiveis on)img::after { content:""; display:block; position:absolute; top:0; left:0; right:0; bottom:0; background:transparent; z-index:1; -webkit-transition:all 1s ease; transition:all 1s ease; }andimg.active::after { background:white; }-- note that instead of using classactive, you could instead just use:hoverto make the image turn white on or off mouse hover.