-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
marzipanmars
committed
May 3, 2017
1 parent
15d26eb
commit 4c4e83d
Showing
20 changed files
with
2,574 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.DS_Store | ||
.sass-cache | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# jQuery Nice Select | ||
|
||
A lightweight jQuery plugin that replaces native select elements with customizable dropdowns. | ||
|
||
## Usage | ||
|
||
Include jQuery and the plugin. | ||
|
||
```html | ||
<script src="path/to/jquery.js"></script> | ||
<script src="path/to/jquery.nice-select.js"></script> | ||
``` | ||
|
||
Include the plugin styles, either the compiled CSS... | ||
|
||
```html | ||
<link rel="stylesheet" href="path/to/nice-select.css"> | ||
``` | ||
|
||
...or, ideally, import the SASS source (if you use SASS) in your main stylesheet for easier customization. | ||
|
||
```scss | ||
@import 'nice-select'; | ||
``` | ||
|
||
Finally, initialize the plugin. | ||
|
||
```javascript | ||
$(document).ready(function() { | ||
$('select').niceSelect(); | ||
}); | ||
``` | ||
|
||
Full documentation and examples at [hernansartorio.com/jquery-nice-select](http://hernansartorio.com/jquery-nice-select). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "jquery-nice-select", | ||
"version": "1.1.0", | ||
"authors": [ | ||
"Hernán Sartorio <[email protected]>" | ||
], | ||
"description": "A lightweight jQuery plugin that replaces native select elements with customizable dropdowns.", | ||
"main": [ | ||
"./css/nice-select.css", | ||
"./js/jquery.nice-select.min.js" | ||
], | ||
"license": "MIT", | ||
"ignore": [ | ||
"**/.*", | ||
"node_modules", | ||
"bower_components", | ||
"test", | ||
"tests" | ||
], | ||
"dependencies": { | ||
"jquery": "~1.11.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
.nice-select { | ||
-webkit-tap-highlight-color: transparent; | ||
background-color: #fff; | ||
border-radius: 5px; | ||
border: solid 1px #e8e8e8; | ||
box-sizing: border-box; | ||
clear: both; | ||
cursor: pointer; | ||
display: block; | ||
float: left; | ||
font-family: inherit; | ||
font-size: 14px; | ||
font-weight: normal; | ||
height: 40px; | ||
line-height: 40px; | ||
outline: none; | ||
padding-left: 18px; | ||
padding-right: 30px; | ||
position: relative; | ||
text-align: center !important; | ||
-webkit-transition: all 0.2s ease-in-out; | ||
transition: all 0.2s ease-in-out; | ||
-webkit-user-select: none; | ||
-moz-user-select: none; | ||
-ms-user-select: none; | ||
user-select: none; | ||
white-space: nowrap; | ||
width: 155px; } | ||
.nice-select:hover { | ||
border-color: #dbdbdb; } | ||
.nice-select:active, .nice-select.open, .nice-select:focus { | ||
border-color: #999; } | ||
.nice-select:after { | ||
border-bottom: 2px solid #999; | ||
border-right: 2px solid #999; | ||
content: ''; | ||
display: block; | ||
height: 5px; | ||
margin-top: -4px; | ||
pointer-events: none; | ||
position: absolute; | ||
right: 12px; | ||
top: 50%; | ||
-webkit-transform-origin: 66% 66%; | ||
-ms-transform-origin: 66% 66%; | ||
transform-origin: 66% 66%; | ||
-webkit-transform: rotate(45deg); | ||
-ms-transform: rotate(45deg); | ||
transform: rotate(45deg); | ||
-webkit-transition: all 0.15s ease-in-out; | ||
transition: all 0.15s ease-in-out; | ||
width: 5px; } | ||
.nice-select.open:after { | ||
-webkit-transform: rotate(-135deg); | ||
-ms-transform: rotate(-135deg); | ||
transform: rotate(-135deg); } | ||
.nice-select.open .list { | ||
opacity: 1; | ||
pointer-events: auto; | ||
-webkit-transform: scale(1) translateY(0); | ||
-ms-transform: scale(1) translateY(0); | ||
transform: scale(1) translateY(0); } | ||
.nice-select.disabled { | ||
border-color: #ededed; | ||
color: #999; | ||
pointer-events: none; } | ||
.nice-select.disabled:after { | ||
border-color: #cccccc; } | ||
.nice-select.wide { | ||
width: 100%; } | ||
.nice-select.wide .list { | ||
left: 0 !important; | ||
right: 0 !important; } | ||
.nice-select.right { | ||
float: right; } | ||
.nice-select.right .list { | ||
left: auto; | ||
right: 0; } | ||
.nice-select.small { | ||
font-size: 12px; | ||
height: 36px; | ||
line-height: 34px; } | ||
.nice-select.small:after { | ||
height: 4px; | ||
width: 4px; } | ||
.nice-select.small .option { | ||
line-height: 34px; | ||
min-height: 34px; } | ||
.nice-select .list { | ||
background-color: #fff; | ||
border-radius: 5px; | ||
box-shadow: 0 0 0 1px rgba(68, 68, 68, 0.11); | ||
box-sizing: border-box; | ||
margin-top: 4px; | ||
opacity: 0; | ||
overflow: hidden; | ||
padding: 0; | ||
pointer-events: none; | ||
position: absolute; | ||
top: 100%; | ||
left: 0; | ||
-webkit-transform-origin: 50% 0; | ||
-ms-transform-origin: 50% 0; | ||
transform-origin: 50% 0; | ||
-webkit-transform: scale(0.75) translateY(-21px); | ||
-ms-transform: scale(0.75) translateY(-21px); | ||
transform: scale(0.75) translateY(-21px); | ||
-webkit-transition: all 0.2s cubic-bezier(0.5, 0, 0, 1.25), opacity 0.15s ease-out; | ||
transition: all 0.2s cubic-bezier(0.5, 0, 0, 1.25), opacity 0.15s ease-out; | ||
z-index: 9; } | ||
.nice-select .list:hover .option:not(:hover) { | ||
background-color: transparent !important; } | ||
.nice-select .option { | ||
cursor: pointer; | ||
font-weight: 400; | ||
line-height: 40px; | ||
list-style: none; | ||
min-height: 40px; | ||
outline: none; | ||
padding-left: 18px; | ||
padding-right: 29px; | ||
text-align: left; | ||
-webkit-transition: all 0.2s; | ||
transition: all 0.2s; } | ||
.nice-select .option:hover, .nice-select .option.focus, .nice-select .option.selected.focus { | ||
background-color: #f6f6f6; } | ||
.nice-select .option.selected { | ||
font-weight: bold; } | ||
.nice-select .option.disabled { | ||
background-color: transparent; | ||
color: #999; | ||
cursor: default; } | ||
|
||
.no-csspointerevents .nice-select .list { | ||
display: none; } | ||
|
||
.no-csspointerevents .nice-select.open .list { | ||
display: block; } |
Oops, something went wrong.