-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdemo.html
41 lines (38 loc) · 1.06 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
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8" >
<title>jQuery InputSearch Demo</title>
</head>
<body>
<div id="demo">
<div class="container">
<style scoped>
.container {
margin: .4em 0;
}
</style>
<input placeholder="Search" />
<input class="input-search input-a" placeholder="Search" />
<input class="input-search input-b" placeholder="Search" />
</div>
<button class="visibility-toggler">Toggle visibility</button>
</div>
<script src="//code.jquery.com/jquery-latest.js"></script>
<script src="dist/jquery.inputsearch.js"></script>
<script>
$(function () {
$('.input-a').inputSearch({
searchIconVisible: false,
});
$('.input-b').inputSearch({
onClear() {
console.log('@onClear');
},
});
const inputSearch = $('.input-search');
$('.visibility-toggler').on('click', inputSearch.toggle.bind(inputSearch));
});
</script>
</body>
</html>