Does SL3 support html BG color or image via Javascript in HTML5?

Hey there. Does anyone happen to know if the JavaScript commands to change the web page background color or image still work in HTML5 output? I tried and it only appears to work with flash output.

Reference:

Document.bgColor = "#990000";

if (document.body){
document.body.background = "image.jpg";
}

7 Replies
Alexandros Anoyatis

Hi Stephanie,

Try this to change the background color instead :

parent.document.body.style.backgroundColor = "#990000";

 

Then, try this to change the background image.

parent.document.body.style.backgroundImage = "url('image.jpg')";
parent.document.body.style.backgroundSize = "cover";
parent.document.body.style.backgroundRepeat = "no-repeat";

Then place image.jpg in the output root, after publish (it won't work cross-domain, i.e. referencing a remote location in line 1).

These should work for both the Flash and HTML5 versions.

Hope this helps,
Alex