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"; }
The posts made by Alex and Stephanie are a bit dated. I'm not sure if they are still subscribed to this thread. You are certainly welcome to reach out to the user directly via the 'Contact Me' option on the user profile if you do not hear back soon.
Biraja, the JS trigger is very temperamental when used in conjuction with the "When timeline starts" trigger. This is not a script issue but a (lingering) Storyline issue.
Try modifying the trigger to "When timeline reaches 0.1" or something as early as that.
7 Replies
Hi Stephanie,
Try this to change the background color instead :
Then, try this to change the background image.
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
That's perfect Alex. Thank you so much for you help!
Hi @Stephanie Harnett
I tried executing the JavaScript on the first page timeline starts. It's not working at my end.
Can you please share a sample .story file for this example?
Hi @Alexandros Anoyatis
I tried executing the JavaScript on the first page timeline starts. It's not working at my end.
Can you please share a sample .story file for this example?
Hi Biraja,
The posts made by Alex and Stephanie are a bit dated. I'm not sure if they are still subscribed to this thread. You are certainly welcome to reach out to the user directly via the 'Contact Me' option on the user profile if you do not hear back soon.
Biraja, the JS trigger is very temperamental when used in conjuction with the "When timeline starts" trigger. This is not a script issue but a (lingering) Storyline issue.
Try modifying the trigger to "When timeline reaches 0.1" or something as early as that.
Yahoooooo!
Working fine now.
Thanks a lot! @Alexandros Anoyatis
This discussion is closed. You can start a new discussion or contact Articulate Support.