-
Notifications
You must be signed in to change notification settings - Fork 0
/
example2.html
155 lines (155 loc) · 6.16 KB
/
example2.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Custom Select Box</title>
<link rel="stylesheet" type="text/css" href="jquery.customselectbox.css" />
<style type="text/css">
* {
margin: 0;
padding: 0;
}
#wrap {
border: solid 1px #c0c0c0;
height: 64px;
margin: 160px auto 0;
overflow: auto;
width: 640px;
}
</style>
<script type="text/javascript" src="jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="jquery.domxy.js"></script>
<script type="text/javascript" src="jquery.customselectbox.js"></script>
<script type="text/javascript">
/*jslint browser: true, devel: true */
/*global jQuery, browserDetect*/
(function (global, $) {
"use strict";
var $document = $(document), $window = $(global);
function elementMaker(type, param) {
var elem = document.createElement(type),
key;
if (param !== undefined && typeof param === "object") {
for (key in param) {
if (param.hasOwnProperty(key)) {
elem.setAttribute(key, param[key]);
}
}
}
return elem;
}
function domTextNodeMaker(string) {
return document.createTextNode(string);
}
$document.ready(function () {
var $select = $('select[name*="select"]');
$select.customSelectBox({ width: '150px' });
$select.on('change', function () {
console.log('changed to: ' + this.value);
}).on('csb:open', function (event, parts) {
//console.log(event);
//console.log(parts);
}).on('csb:dropdownrefresh', function (event, parts) {
//console.log('refresh');
});
$document.on('keydown', function (event) {
event.preventDefault();
});
});
}(window, jQuery));
</script>
</head>
<body>
<div id="wrap">
<select name="selection" data-placeholder="Nothing to see here">
<option value="Jaycliff">Jaycliff</option>
<option value="Arcilla">Arcilla</option>
<optgroup label="This is a simulated optgroup">
<option value="is">is</option>
<option value="so" disabled="disabled">so</option>
</optgroup>
<option value="freaking">feaking</option>
<option value="awesome">awesome</option>
<optgroup label="Pokemon">
<option value="Hey">Hey</option>
<option value="You" disabled="disabled">You</option>
<option value="Pikachu!">Pikachu!</option>
</optgroup>
</select>
<select name="selectioner" data-placeholder="Nothing to see here">
<optgroup label="Power Rangers">
<option value="Red Ranger">Red Ranger</option>
<option value="Blue Ranger">Blue Ranger</option>
<option value="Black Ranger">Black Ranger</option>
<option value="Yellow Ranger">Yellow Ranger</option>
<option value="Pink Ranger">Pink Ranger</option>
</optgroup>
<option value="idiot">idiot</option>
<option value="crazy">crazy</option>
<optgroup label="Random">
<option value="Kung">Kung</option>
<option value="Fu">Fu</option>
</optgroup>
<option value="feeling pogi">feeling pogi</option>
<option value="imbecile">imbecile</option>
</select>
<select name="selectionist" data-placeholder="Nothing to see here">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
<select>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
</div>
<!-- Template by Jaycliff Arcilla -->
<!--
<div style="width: 320px; height: 240px; overflow: auto;" id="box">
What<br />
the<br />
hell<br />
is<br />
that<br />
shit<br />
you<br />
limey<br />
fuck<br />
What<br />
the<br />
hell<br />
is<br />
that<br />
shit<br />
you<br />
limey<br />
fuck<br />
</div>
<script type="text/javascript">
$('#box').on('scroll', function (event) {
console.log(event);
console.log('BOX: They see me scrolling, they hating...');
});
$(window).on('scroll', function (event) {
console.log('WINDOW: They see me scrolling, they hating...');
});
</script>
-->
</body>
</html>