How do I build a canvas in the slide using a javascript script in a trigger object? I have tried to place a <canvas></canvas> into the slide document innerHTML, however it doesn't seem to work? Any advice would be appreciated. (Using Story Line 2) Colman
As far as I know, you can add a <canvas> tag by way of your JS Trigger. However, it will not be contained within the slide itself but rather the parent .html document. If someone does know how to target a specific slide, i would be interested to know as well.
What you might try is to embed the canvas object within a page as a Web Object. You can create a separate index.html file containing the canvas content. Then, embed that into your Storyline page by way of Insert > Web Object. Select the local folder containing the index.html file and import it onto your slide.
2 Replies
Hi Colman,
As far as I know, you can add a <canvas> tag by way of your JS Trigger. However, it will not be contained within the slide itself but rather the parent .html document. If someone does know how to target a specific slide, i would be interested to know as well.
What you might try is to embed the canvas object within a page as a Web Object. You can create a separate index.html file containing the canvas content. Then, embed that into your Storyline page by way of Insert > Web Object. Select the local folder containing the index.html file and import it onto your slide.
Hi Colman,
Here are a few topics of discussion you may find useful.
Insert HTML5 Canvas into Storyline as a web object:
https://community.articulate.com/discussions/articulate-storyline/insert-html5-canvas-into-storyline-as-a-web-object
How to target the canvas in a web object?
https://community.articulate.com/discussions/articulate-storyline/how-to-target-the-canvas-in-a-web-object
Storyline Player Javascript interaction
https://community.articulate.com/discussions/articulate-storyline/storyline-player-javascript-interaction
I'm afraid my Javascript knowledge is limited, but hopefully these may help.
This discussion is closed. You can start a new discussion or contact Articulate Support.