This is the CSS part (using background-size: cover):
#container>div {
background: url("../static/opti2.jpg");
background-size: cover;
background-attachment: fixed;
transition: all 0.5s ease-in;
}
What I want to do is change the URL background using Javascript.
As mentioned in a comment above, use this code, replacing the URL with the new URL.