How can I apply interactions to background images?

I’d link a background image to change opacity when scrolling, but it doesn’t seem possible to apply interactions to a background image of an element.

Put the background image in a standalone div and set the opacity of the background div instead.

I’m not sure I understand. Could you explain it further? Thanks for your help.

Create a new div and set the positioning to absolute and “fill” so that it displays in the full size of the parent element. Then set the z-index as such so that it rests behind the other items and you can control it separately.

1 Like