JSFiddle - React, Tailwind, and code Playground
by Trisox
HTML
<script src="http://jamielottering.github.com/DropKick/js/jquery.dropkick.1-0.1.js"></script>
<link rel="stylesheet" href="http://jamielottering.github.com/DropKick/css/demo.css">
<select id="timePreference">
<option value="Choose" selected="selected">Choose</option>
<option value="1">1</option>
<option value="2">2</option>>
</select>
<input name="go" id="go" type="button" value="change" />
CSS
/**
* Default DropKick theme
*
* Feel free to edit the default theme
* or even add your own.
*
* See the readme for themeing help
*
*/
/***** Begin Theme, feel free to edit in here! ******/
.dk_container * {
margin: 0;
padding: 0;
}
/* One container to bind them... */
.dk_container {
background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f5f5f5));
background: -moz-linear-gradient(top, #fff, #f5f5f5);
background: -o-linear-gradient(top, #fff, #f5f5f5);
background-color: #f5f5f5;
font-family: 'Helvetica', Arial, sans-serif;
font-size: 12px;
font-weight: bold;
line-height: 10px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
.dk_container:focus {
outline: 0;
}
.dk_container a {
cursor: pointer;
text-decoration: none;
}
.dk_container ul {
list-style-type: none;
}
/* Opens the dropdown and holds the menu label */
.dk_toggle {
/**
* Help: Arrow image not appearing
* Try updating this property to your correct dk_arrows.png path
*/
border: 1px solid #ccc;
color: #333;
padding: 7px 45px 7px 10px;
text-shadow: #fff 1px 1px 0;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-webkit-transition: border-color .5s;
-moz-transition: border-color .5s;
-o-transition: border-color .5s;
transition: border-color .5s;
}
.dk_toggle:hover {
border-color: #8c8c8c;
}
/* Applied when the dropdown is focused */
.dk_focus .dk_toggle {
border-color: #40b5e2;
}
.dk_focus .dk_toggle {
box-shadow: 0 0 5px #40b5e2;
-moz-box-shadow: 0 0 5px #40b5e2;
-webkit-box-shadow: 0 0 5px #40b5e2;
}
/* Applied whenever the dropdown is open */
.dk_open {
box-shadow: 0 0 5px #40b5e2;
-moz-box-shadow: 0 0 5px #40b5e2;
-webkit-box-shadow: 0 0 5px #40b5e2;
/**
* Help: Dropdown menu is covered by something
* Try setting this value higher
*/
z-index: 10;
}
.dk_open .dk_toggle {
background-color:...
JavaScript
$(document).ready(function() {
$('#timePreference').dropkick();
$('#go').click(function(){
$('#timePreference').val("");
$('.dk_label').text('Choose');
$(".dk_options_inner li").each(function(){
$(this).removeAttr('class');
if ($(this).text() == ""){
$(this).attr('class', 'dk_option_current');
}
});
});
});