Jump to content
Search Community

Target body {background-image)

Sunflair test
Moderator Tag

Go to solution Solved by OSUblake,

Recommended Posts

I am working on a program that transitions the background image depending the level the player is on.  The line of code is:

 

document.body.style.backgroundImage =`url(/dist/asset.round${round}.png)`;

I would like the background to fade in  or out to reveal the next level's background image. 

I am really not picky about the transition, I just want to get rid of the abruptness of the change.

 

How do I target the background image to alter opacity, duration 2?

I am working in Javascript.

 

Edited by Sunflair
neglected to say what language I was using.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...