Created
November 11, 2016 10:34
-
-
Save Guley/0bf90235cb57c36d41bec3d24c27afa3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type='file' name="image" onchange="preview(this);" multiple="multiple" /> | |
<div id='previewImg'></div> | |
<script> | |
window.preview = function (input) { | |
if (input.files && input.files[0]) { | |
$(input.files).each(function () { | |
var reader = new FileReader(); | |
reader.readAsDataURL(this); | |
reader.onload = function (e) { | |
$("#previewImg").append("<img class='thumb' src='" e.target.result "'>"); | |
} | |
}); | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment