
HTML MarkUp:
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> | |
<option class="font1" value="volvo">Volvo</option> | |
<option class="font2" value="saab">Saab</option> | |
<option class="font3" value="opel">Opel</option> | |
<option class="font4" value="audi">Audi</option> | |
</select> |
StyleSheet (CSS):
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
.font1{ font-style:italic;} | |
.font2{color:red;} | |
.font3{ font-weight:600;} | |
.font4{ background-color:#0CC} |
select
. In this case we can use jquery , they hide select element and show a look a like usually they are either <ul>/<li>
,<span>
or <div>
. Through css we can change the style.Links:
<script src="http://code.jquery.com/jquery-1.11.3.js"></script>
<script src="http://code.jquery.com/ui/1.11.3/jquery-ui.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.css" />
HTML MarkUp:
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> | |
<option>select</option> | |
<option>one</option> | |
<option>two</option> | |
<option>three</option> | |
</select> |
StyleSheet (CSS):
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
li, span {text-decoration: underline; } | |
.ui-selectmenu-button { width:150px !important; } |
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
<script> | |
$(document).ready(function(){ | |
$('select').selectmenu(); | |
}) | |
</script> |
No comments :
Post a Comment