Note that there are some explanatory texts on larger screens.

plurals
  1. POUpload image and position
    primarykey
    data
    text
    <p>I have found a lot of tutorials on html5 image upload e.g.</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="content-type" content="text/html; charset=UTF-8"&gt; &lt;script type='text/javascript' src='/js/lib/mootools-core-1.4.5-nocompat.js'&gt;&lt;/script&gt; &lt;link rel="stylesheet" type="text/css" href="/css/normalize.css"&gt; &lt;link rel="stylesheet" type="text/css" href="/css/result-light.css"&gt; &lt;style type='text/css'&gt; &lt;/style&gt; &lt;script type='text/javascript'&gt;//&lt;![CDATA[ window.addEvent('load', function() { var imageLoader = document.getElementById('imageLoader'); imageLoader.addEventListener('change', handleImage, false); var canvas = document.getElementById('imageCanvas'); var ctx = canvas.getContext('2d'); function handleImage(e){ var reader = new FileReader(); reader.onload = function(event){ var img = new Image(); img.onload = function(){ canvas.width = img.width; canvas.height = img.height; ctx.drawImage(img,0,0); } img.src = event.target.result; } reader.readAsDataURL(e.target.files[0]); } });//]]&gt; &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;label&gt;Image File:&lt;/label&gt;&lt;br/&gt; &lt;input type="file" id="imageLoader" name="imageLoader"/&gt; &lt;canvas id="imageCanvas"&gt;&lt;/canvas&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>But how would I preview an image without it overwriting the previous. I want to be able to upload as many images as I like and just have them horizontally aligned or positioned according to a style sheet.</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. 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