Created
March 7, 2013 18:16
-
-
Save ultim8k/5110364 to your computer and use it in GitHub Desktop.
SelectBox hack
This file contains hidden or 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
/** | |
* SelectBox hack | |
*/ | |
body{ | |
background-color: rgba(30,70,150,0.5); | |
font-family:Arial; | |
} | |
.cnt{ | |
width:200px; | |
margin:150px auto; | |
} | |
select{ margin-bottom:20px; } | |
.selectBox{ | |
height:30px; | |
width:200px; | |
background-color:white; | |
position:relative; | |
cursor:pointer; | |
} | |
.selectOptions{ | |
list-style:none; | |
margin:0; | |
padding:0; | |
display:none; | |
position:absolute; | |
bottom:-100%; | |
background-color:white; | |
width:100%; | |
} | |
.selectBox:focus .selectOptions, | |
.selectOptions:focus{ | |
display:block; | |
} | |
.selectOption:hover, | |
.selectOption:focus{ | |
background-color:rgba(30,70,150,0.5); | |
} |
This file contains hidden or 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
<div class="cnt"> | |
<select> | |
<option>Option 1</option> | |
<option>Option 2</option> | |
<option>Option 3</option> | |
</select> | |
<div class='selectBox' tabindex="0" id="knownas"> | |
<span class='selected'></span> | |
<ul class="selectOptions" tabindex="0"> | |
<li class="selectOption" tabindex="0" value="">Select an option</li> | |
<li class="selectOption" tabindex="0" value="">Select an option</li> | |
</ul> | |
</div> | |
</div> |
This file contains hidden or 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
// alert('Hello world!'); |
This file contains hidden or 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
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment