I am working on a project with a div
that has a background-image
. The goal is to make the image fade away when a button is clicked, and then fade in again when another button is pressed. The focus is on only fading the background image while keeping the content unaffected.
Any suggestions on how to achieve this effect? I have experimented with jQuery's animate()
without success. CSS transitions do not seem to be effective either, as altering the opacity
makes all the content transparent as well.