Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It's not too difficult to put together a basic scribbling app using just html. I'll let you work out the details of making it production ready.</p> <p>I'm using <a href="http://extjs.com/" rel="noreferrer">extjs</a> here as a cross browser event framework, but you can use whatever you're comfortable with (jquery). I'm also using <a href="http://raphaeljs.com/" rel="noreferrer">Raphael</a> to get cross browser drawing functionality.</p> <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;TestPage&lt;/title&gt; &lt;script language="javascript" src="raphael-src.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="extjs/adapter/ext/ext-base.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="extjs/ext-all-debug.js"&gt;&lt;/script&gt; &lt;script language="javascript"&gt; scribbler = function (container, width, height) { this.canvas = Raphael(container, width, height); this.currentdraw = null; Ext.get(container).on('mousedown', function(e) { var el = Ext.get(container); this.currentdraw = this.canvas.path({ stroke: "black", fill: "none", "stroke-width":4 }); this.currentdraw.moveTo(e.getPageX() - el.getLeft(), e.getPageY() - el.getTop()); }, this); Ext.get(container).on('mousemove', function(e) { var el = Ext.get(container); if (this.currentdraw != null) { this.currentdraw.lineTo(e.getPageX() - el.getLeft(), e.getPageY() - el.getTop()); } }, this); Ext.get(container).on('mouseup', function(e) { this.currentdraw = null; }, this); } var scribble; Ext.onReady( function() { scribble = new scribbler("container", 800,600); } ); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="container" style="position:relative;border:1px solid black;width:640px;height:400px"&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>You'll have to record and store the various scribble lines in a form for submission. And ensure that the mouse pointer is correct all the time (it's a text bar under IE).</p> <p>Anyway, enjoy.</p> <p>PS. I've uploaded a working example including raphael and complete extjs2 libraries to <a href="http://drop.io/eynk9sm" rel="noreferrer">drop.io</a> (3Mb, <a href="http://www.7-zip.org/" rel="noreferrer">7zip</a>).</p> <p>PPS. I've uploaded a working example which is a basic (but pretty much a complete) control. See <a href="http://inquisitiveturtle.co.uk/scribbler/" rel="noreferrer">inquisitiveturtle</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload