-
Notifications
You must be signed in to change notification settings - Fork 1
/
sample.html
executable file
·158 lines (134 loc) · 7.42 KB
/
sample.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
156
157
158
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Making Better Select Elements with jQuery and CSS3 | Tutorialzine Demo</title>
<link rel="stylesheet" type="text/css" href="css/styles.css" />
<link rel="stylesheet" type="text/css" href="css/premium-select.css" />
</head>
<body>
<div id="page">
<h1>Premium Select</h1>
<form method="post" action="">
<h3>Simplest Approach</h3>
<!-- We are going to use jQuery to hide the select element and replace it -->
<select class="premiumSelect">
<option value="0" selected="selected">Choose an Option</option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
<option value="4">Option 4</option>
</select>
<h3>Hide an Option</h3>
<select class="premiumSelect">
<option value="0" selected="selected" data-skip="1">Choose an Option</option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
<option value="4">Option 4</option>
</select>
<h3>Icons Included</h3>
<select class="premiumSelect" data-has-icon="1">
<option value="0" selected="selected" data-skip="1">Choose Your Product</option>
<option value="1" data-icon="img/products/iphone.png">iPhone 4</option>
<option value="2" data-icon="img/products/ipod.png">iPod</option>
<option value="3" data-icon="img/products/air.png">MacBook Air</option>
<option value="4" data-icon="img/products/imac.png">iMac</option>
</select>
<h3>Data Attributes</h3>
<select class="premiumSelect" data-has-icon="1" data-select-width="250px" data-list-width="300px">
<option value="0" selected="selected" data-skip="1">Choose Your Product</option>
<option value="1" data-icon="img/products/iphone.png" data-line-1="iPhone 5" data-line-2="Loving it is easy!">iPhone 4</option>
<option value="2" data-icon="img/products/ipod.png" data-line-1="iPod" data-line-2="Play music and more!">iPod</option>
<option value="3" data-icon="img/products/air.png" data-line-1="Macbook Air (out of stock)" data-line-2="Thin, fast, powerful!">MacBook Air</option>
<option value="4" data-icon="img/products/imac.png" data-line-1="iMac" data-line-2="Performance and design at the edge.">iMac</option>
</select>
<h3>Use a Theme</h3>
<div style="margin-bottom:20px;">
<h4>Olive</h4>
<select class="premiumSelect" data-theme="olive" data-select-width="140px" data-list-width="250px">
<option value="0" data-line-1="All Locations" selected="selected">All Locations</option>
<option value="1" data-line-1="A really long named item for testing" data-line-2="10254 Coors Blvd Byp NW">A really long named item for testing</option>
<option value="2" data-line-1="Starbucks" data-line-2="5501 Montgomery Blvd NE">Starbucks #2</option>
<option value="3" data-line-1="Starbucks" data-line-2="201 La Posada Rd">Starbucks #3</option>
<option value="4" data-line-1="Starbucks" data-line-2="9821 Montgomery Blvd NE">Starbucks #4</option>
</select>
</div>
<div style="margin-bottom:20px;">
<h4>Orange Click</h4>
<span style="font-size: 18px;font-weight: bold;">Featured Deals from BuzzTown Members in </span><select class="premiumSelect" data-theme="orange-click" data-list-width="250px" data-hover-activated="1">
<option value="1" data-line-1="Albuquerque" data-line-2="and surrounding area">Albuquerque and surrounding area</option>
<option value="0" data-line-1="Durango" data-line-2="and surrounding area" selected="selected">Durango and surrounding area</option>
<option value="2" data-line-1="El Paso" data-line-2="and surrounding area">El Paso and surrounding area</option>
<option value="2" data-line-1="Farmington" data-line-2="and surrounding area">Farmington and surrounding area</option>
<option value="3" data-line-1="Grand Junction" data-line-2="and surrounding area">Grand Junction and surrounding area</option>
<option value="4" data-line-1="Tucson" data-line-2="and surrounding area">Tucson and surrounding area</option>
</select>
</div>
</form>
<h1>Initialization and Methods</h1>
<form method="POST" action="">
<h3>Manual Initialization</h3>
<select id="manualInitialization">
<option value="0" selected="selected" data-skip="1">In the begining I'm not initialized</option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
<option value="4">Option 4</option>
</select>
<br />
<br />
<button id="engage">Engage!</button>
</form>
<form method="POST" action="">
<h3>Automation</h3>
<button id="show">Show</button>
<button id="hide">Hide</button>
<button id="toggle">Toggle</button>
<br />
<br />
<select id="automation" class="premiumSelect">
<option value="0" selected="selected" data-skip="1">I'm automated</option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
<option value="4">Option 4</option>
</select>
</form>
</div>
<!-- Feel free to remove this footer -->
<div class="footer">
This work was created by Jocko MacGregor for <a href="http://www.bdmedia.com/">Ballantine Digital Media</a>, and is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported License</a>.
<br />
<a rel="license" href="http://creativecommons.org/licenses/by/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by/3.0/88x31.png" /></a>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script src="js/premium-select-0.1.3b.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('button#engage').click(function(evt){
evt.preventDefault();
$('select#manualInitialization').premiumSelect({
select_width: '300px',
list_width: '220px'
});
});
$('button#show').click(function(evt){
evt.preventDefault();
evt.stopPropagation();
$('select#automation').premiumSelect('show');
});
$('button#hide').click(function(evt){
evt.preventDefault();
evt.stopPropagation();
$('select#automation').premiumSelect('hide');
});
$('button#toggle').click(function(evt){
evt.preventDefault();
evt.stopPropagation();
$('select#automation').premiumSelect('toggle');
});
});
</script>
</body>
</html>