insert HTML5 Canvas into Storyline as a web object

Jul 11, 2012

Hello,

I'm trying to insert HTML5 Canvas into Storyline as a web object from my computer. It works until I load it to the LMS which says it does not support Canvas.

Does anyone have any suggestions? I need an area where the user can draw. It does not need to be saved, printed or recognized by the LMS.

Thanks!

Shelley

18 Replies
Shelley Richey

I have IE9.  Not sure if it is forcing it to convert to IE8?

Here is the code for Canvas.

Drawing


$( document ).ready( function() {
 var canvas = document.getElementById( 'canvas' );
 var context = null;
 
 if( canvas.getContext )
 {
  context = canvas.getContext( '2d' );
  
  $( '#canvas' ).mousedown( function( evt ){
   var offset = $( '#canvas' ).offset();
   

   context.clearRect( 0, 0, 300, 200);
   context.beginPath()
   context.moveTo( evt.pageX - offset.left, evt.pageY - offset.top);
   $( document ).mousemove( function( evt ){
    var offset = $( '#canvas' ).offset();
    
    context.lineTo( evt.pageX - offset.left, evt.pageY - offset.top);
    context.stroke();
   }).mouseup( function() {
    $( document ).unbind( 'mousemove' );
    $( document ).unbind( 'mouseup' );
   });
  });
 } else {
  alert( 'Canvas not supported' );
 }
} );


 

This discussion is closed. You can start a new discussion or contact Articulate Support.