Skip to content

Commit 2524be3

Browse files
committed
Added <optgroup> support
Added <optgroup> support Changed Sass file to easier customization, and stripped-down some properties Small fixes
1 parent c03b17b commit 2524be3

14 files changed

+1451
-360
lines changed

.csscomb.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"always-semicolon": true,
3+
"block-indent": 2,
4+
"color-case": "upper",
5+
"color-shorthand": true,
6+
"leading-zero": true,
7+
"remove-empty-rulesets": true,
8+
"space-after-colon": 1,
9+
"space-after-combinator": 1,
10+
"space-between-declarations": "\n",
11+
"space-after-opening-brace": "\n",
12+
"space-after-selector-delimiter": 1,
13+
"space-before-closing-brace": "\n",
14+
"space-before-colon": 0,
15+
"space-before-combinator": 1,
16+
"unitless-zero": true,
17+
"vendor-prefix-align": true,
18+
"strip-spaces": false,
19+
"tab-size": 2
20+
}

README.md

Lines changed: 44 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jQuery Selectric is a jQuery plugin designed to help at stylizing and manipulati
1616
Make sure to include jQuery in your page:
1717

1818
```html
19-
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
19+
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
2020
```
2121

2222
Include **jQuery Selectric:**
@@ -28,13 +28,11 @@ Include **jQuery Selectric:**
2828
Put styles in your CSS and change it to your taste :D
2929

3030
```css
31-
/*======================================================================
31+
/*======================================
3232
Selectric
33-
======================================================================*/
33+
======================================*/
3434
.selectricWrapper {
3535
position: relative;
36-
margin: 0 0 10px;
37-
width: 300px;
3836
cursor: pointer;
3937
}
4038

@@ -46,31 +44,29 @@ Put styles in your CSS and change it to your taste :D
4644
border: 1px solid #DDD;
4745
background: #F8F8F8;
4846
position: relative;
49-
border-radius: 2px;
5047
}
5148
.selectric .label {
5249
display: block;
5350
white-space: nowrap;
5451
overflow: hidden;
55-
margin: 0 30px 0 0;
56-
padding: 6px;
52+
text-overflow: ellipsis;
53+
margin: 0 38px 0 10px;
5754
font-size: 12px;
58-
line-height: 18px;
55+
line-height: 38px;
5956
color: #444;
60-
min-height: 18px;
57+
height: 38px;
6158
}
6259
.selectric .button {
6360
display: block;
6461
position: absolute;
6562
right: 0;
6663
top: 0;
67-
width: 30px;
68-
height: 30px;
64+
width: 38px;
65+
height: 38px;
6966
color: #BBB;
7067
text-align: center;
7168
font: 0/0 a;
72-
/* IE Fix */
73-
*font: 20px/30px Lucida Sans Unicode, Arial Unicode MS, Arial;
69+
*font: 20px/38px Lucida Sans Unicode, Arial Unicode MS, Arial;
7470
}
7571
.selectric .button:after {
7672
content: " ";
@@ -88,21 +84,17 @@ Put styles in your CSS and change it to your taste :D
8884
}
8985

9086
.selectricHover .selectric {
91-
border-color: #CCC;
87+
border-color: #C4C4C4;
9288
}
9389
.selectricHover .selectric .button {
94-
color: #888;
95-
}
96-
.selectricHover .selectric .button:after {
97-
border-top-color: #888;
90+
color: #A2A2A2;
9891
}
9992

10093
.selectricOpen {
10194
z-index: 9999;
10295
}
10396
.selectricOpen .selectric {
104-
border-color: #CCC;
105-
background: #F0F0F0;
97+
border-color: #C4C4C4;
10698
}
10799
.selectricOpen .selectricItems {
108100
display: block;
@@ -112,7 +104,6 @@ Put styles in your CSS and change it to your taste :D
112104
filter: alpha(opacity=50);
113105
opacity: 0.5;
114106
cursor: default;
115-
-webkit-touch-callout: none;
116107
-webkit-user-select: none;
117108
-moz-user-select: none;
118109
-ms-user-select: none;
@@ -159,8 +150,8 @@ Put styles in your CSS and change it to your taste :D
159150
position: absolute;
160151
top: 100%;
161152
left: 0;
162-
background: #F9F9F9;
163-
border: 1px solid #CCC;
153+
background: #F8F8F8;
154+
border: 1px solid #C4C4C4;
164155
z-index: -1;
165156
box-shadow: 0 0 10px -6px;
166157
}
@@ -182,7 +173,7 @@ Put styles in your CSS and change it to your taste :D
182173
}
183174
.selectricItems li {
184175
display: block;
185-
padding: 5px;
176+
padding: 8px;
186177
border-top: 1px solid #FFF;
187178
border-bottom: 1px solid #EEE;
188179
color: #666;
@@ -191,18 +182,41 @@ Put styles in your CSS and change it to your taste :D
191182
.selectricItems li.selected {
192183
background: #EFEFEF;
193184
color: #444;
194-
border-top-color: #E0E0E0;
195185
}
196186
.selectricItems li:hover {
197187
background: #F0F0F0;
198188
color: #444;
199189
}
200-
.selectricItems li.disabled {
201-
background: #F5F5F5;
202-
color: #BBB;
203-
border-top-color: #FAFAFA;
190+
.selectricItems .disabled {
191+
filter: alpha(opacity=50);
192+
opacity: 0.5;
193+
cursor: default !important;
194+
background: none !important;
195+
color: #666 !important;
196+
-webkit-user-select: none;
197+
-moz-user-select: none;
198+
-ms-user-select: none;
199+
user-select: none;
200+
}
201+
.selectricItems .selectricGroup .selectricGroupLabel {
202+
font-weight: bold;
203+
padding-left: 10px;
204204
cursor: default;
205+
-webkit-user-select: none;
206+
-moz-user-select: none;
207+
-ms-user-select: none;
208+
user-select: none;
209+
background: none;
210+
color: #444;
211+
}
212+
.selectricItems .selectricGroup.disabled li {
213+
filter: alpha(opacity=100);
214+
opacity: 1;
205215
}
216+
.selectricItems .selectricGroup li {
217+
padding-left: 25px;
218+
}
219+
206220
```
207221

208222
Initialize **jQuery Selectric:**

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "jquery-selectric",
33
"description": "Fast, simple and light jQuery plugin to customize HTML selects",
4-
"version": "1.8.7",
4+
"version": "1.9.0",
55
"keywords": [
66
"select",
77
"selectbox",

0 commit comments

Comments
 (0)