-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
45 lines (40 loc) · 1.25 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
<!DOCTYPE html>
<head>
<title>LiveSearch plugin</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="vendor/jquery-1.9.1.min.js"><\/script>')</script>
<script src="js/jquery.liveSearch.js"></script>
<script>
$(document).ready(function() {
function guid() { // GUID generator from http://stackoverflow.com/a/2117523
var guid = 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
return v.toString(16);
});
return guid;
}
var divs = 3000;
var fragment = document.createDocumentFragment();
while(divs--){
var newdiv = document.createElement('p');
newdiv.innerHTML = guid();
fragment.appendChild(newdiv);
}
document.getElementsByClassName('live-search')[0].appendChild(fragment);
$('.live-search').liveSearch({highlight: true, highlightcolor: '#FFB6C1'});
});
</script>
<style>
p {
margin: 2px 0;
}
.live-search {
width: 270px;
}
</style>
</head>
<body>
<input type="text" id="search" class="clearfix" name="search" placeholder="Search here!" autofocus="autofocus">
<div class="live-search"></div>
</body>
</html>