Created
August 21, 2013 12:56
-
-
Save benbabics/6294121 to your computer and use it in GitHub Desktop.
A CodePen by benbabics.
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
<select id="countries" data-placeholder="Choose a Country"> | |
<option value=""></option> | |
<option value="United States">United States</option> | |
<option value="United Kingdom">United Kingdom</option> | |
<option value="Afghanistan">Afghanistan</option> | |
<option value="Aland Islands">Aland Islands</option> | |
<option value="Albania">Albania</option> | |
<option value="Algeria">Algeria</option> | |
<option value="American Samoa">American Samoa</option> | |
<option value="Andorra">Andorra</option> | |
<option value="Angola">Angola</option> | |
<option value="Anguilla">Anguilla</option> | |
<option value="Antarctica">Antarctica</option> | |
<option value="Antigua and Barbuda">Antigua and Barbuda</option> | |
<option value="Argentina">Argentina</option> | |
<option value="Armenia">Armenia</option> | |
<option value="Aruba">Aruba</option> | |
<option value="Australia">Australia</option> | |
<option value="Austria">Austria</option> | |
<option value="Azerbaijan">Azerbaijan</option> | |
<option value="Bahamas">Bahamas</option> | |
<option value="Bahrain">Bahrain</option> | |
<option value="Bangladesh">Bangladesh</option> | |
<option value="Barbados">Barbados</option> | |
<option value="Belarus">Belarus</option> | |
<option value="Belgium">Belgium</option> | |
<option value="Belize">Belize</option> | |
<option value="Benin">Benin</option> | |
</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
function init() { | |
$('#countries').chosen(); | |
} | |
$(init); |
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
@import "compass"; | |
.chosen-container { | |
// styling | |
.chosen-single { | |
border : none; | |
background: none; | |
box-shadow: none; | |
span { | |
color: blue; | |
text-decoration: underline; | |
} | |
} | |
// avoid text shift | |
.chosen-single span { | |
padding-top: 2px; | |
} | |
&.chosen-container-active span { | |
padding-top: 0; | |
} | |
// dropdown arrow | |
.chosen-single span + div { | |
display: none; | |
} | |
&.chosen-container-active.chosen-with-drop { | |
span + div { | |
display: block; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment