-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
97 lines (70 loc) · 2.53 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Sample ajax multiple upload preview</title>
<link href="./css/style.css" rel="stylesheet" type="text/css">
<link href="./css/multiple-upload.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="wrapper">
<div id="header">
<div id="nav-container">
<div id="nav">
<ul class="top">
<li><span><a href="https://github.com/santanamic/ajax-multiple-upload.git" class="active">⇩ DOWNLOAD</a></span></li>
</ul>
</div>
</div>
<div id="logo">
<h1>Sample ajax multiple upload preview</h1>
<h2>Creating in 09th, January of 2017 At 00:08 o'clock by WILLIAN SANTANA</h2>
</div>
</div>
<div id="contents-wrapper">
<div class="code">
<h3>Introduction of Ajax Mltiple Upload Preview</h3><br>
<br>
<img src="./images/sample.gif">
<br><br>
<p>Using a function FileReader() to HTML5, users may have a preview of the image before it will pass to the server.</p><br>
</div>
<div class="code">
<h3>This is the basic version.</h3>
<strong>JAVASCRIPT</strong>
<span>1 - Import jquery file</span>
<p></p>
<blockquote><script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
</blockquote>
<span>2 - This is the basics to get started</span>
<blockquote> var pictures = [];
$('#upload-pwer').on('change', '.insert-files', function () {
// Scrolling through all the selected images in the input file
$.each($(this)[0].files, function( index, image ) {
// Saving images in array
pictures.push(image);
// Creating thumbnails of images
var reader = new FileReader();
reader.onload = function(e) {
var preLink = e.target.result;
var itemIMG = '<div><img src="' + preLink + '" /></div>';
var insertIMG = $('#upload-pwer').prepend(itemIMG);
}
reader.readAsDataURL(image);
});
});
</blockquote>
<strong>HTML</strong><span>1 - insert code basic content and button input file</span>
<blockquote> <div id="upload-pwer">
<input class="insert-files" multiple type="file">
</div>
</blockquote>
</div>
<div class="code">
<h3>View full demo</h3><br>
<br>
<p>View full demo for <a href="./demo.html">Ajax code multiple upload preview</a></p>
</div>
</div>
</div>
</body></html>