Adding HTML5 Canvas to page

  1. 8 years ago

    Is there a way to add a CANVAS tag to a Smart Object?
    I've tried this:

    <body onload="init();" style="background-color:#9aaede;margin:0px;">
    	<canvas id="canvas" width="900" height="360" style="background-color:#FFFFFF">CANVAS NOT SUPPORTED</canvas>
    </body>

    But, when I publish, I get an error, saying that a Body tag is not allowed in this area.

  2. Never mind, I figured it out. Here is the answer…

    <script type="text/javascript"><![CDATA[
    $(document).ready(function() {
    window.init();
    	
    });
    ]]></script>
    
    	<canvas id="canvas" width="900" height="360" style="background-color:#FFFFFF">Canvas is not supported, sorry.</canvas>
 

or Sign Up to reply!