-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdemo.html
84 lines (70 loc) · 1.62 KB
/
demo.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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>barcode-scanner.js DEMO</title>
<!-- include source files here... -->
<script type="text/javascript" src="vendor/jquery.2.0.3.min.js"></script>
<script type="text/javascript" src="barcode-scanner.js"></script>
<script type="text/javascript">
jQuery(function(){
$('form').on('submit', function(e){
e.preventDefault();
var $input = $(this).find('input');
$(this).after("<div class='scan'>"+$input.val()+"</div>");
$input.val('');
$input.blur();
});
});
</script>
<style>
body {
background: #EEE;
padding: 14px;
}
table, tr, td {
width: 100%;
}
input {
border: 1px solid #AAA;
background: white;
border-radius: 4px;
padding: 1%;
font-size: 26px;
width: 98%;
}
h2 {
font-family: arial;
color: black;
}
p {
font-family: arial;
color: black;
}
.scan {
background: #99F;
border: 1px solid #77F;
font-family: arial;
font-size: 14px;
padding: 1%;
width: 98%;
color: black;
margin-top: 1px;
border-radius: 4px;
}
</style>
</head>
<body>
<h2>This is a barcode-scanner.js DEMO</h2>
<p>Simply start scanning barcodes using your scanner. Focusing the input field is NOT required.</p>
<table>
<tr>
<td>
<form>
<input name='scan' type='text' data-barcode-scanner-target/>
</form>
</td>
</tr>
</table>
</body>
</html>