mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-12-07 06:14:24 +00:00
40a9d1dfdb
This widget replaces the buttonset widget
54 lines
1.5 KiB
HTML
54 lines
1.5 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>jQuery UI Controlgroup - Split Button</title>
|
|
<link rel="stylesheet" href="../../themes/base/all.css">
|
|
<script src="../../external/jquery/jquery.js"></script>
|
|
<script src="../../ui/core.js"></script>
|
|
<script src="../../ui/widget.js"></script>
|
|
<script src="../../ui/button.js"></script>
|
|
<script src="../../ui/checkboxradio.js"></script>
|
|
<script src="../../ui/menu.js"></script>
|
|
<script src="../../ui/position.js"></script>
|
|
<script src="../../ui/selectmenu.js"></script>
|
|
<script src="../../ui/controlgroup.js"></script>
|
|
<link rel="stylesheet" href="../demos.css">
|
|
<script>
|
|
$(function() {
|
|
$( "select" ).selectmenu({
|
|
classes: {
|
|
"ui-selectmenu-button": "ui-button-icon-only"
|
|
},
|
|
change: function(){
|
|
$( ".output" ).append( "<li>" + this.value + "</li>" );
|
|
}
|
|
});
|
|
$( ".controlgroup" ).controlgroup();
|
|
$( "button" ).click(function() {
|
|
$( ".output" ).append( "<li>Running Last Action...</li>" );
|
|
});
|
|
});
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div class="widget">
|
|
<h1>Split button</h1>
|
|
<div class="controlgroup">
|
|
<button>Run last option</button>
|
|
<select>
|
|
<option>Open...</option>
|
|
<option>Save</option>
|
|
<option>Delete</option>
|
|
</select>
|
|
</div>
|
|
<br/>
|
|
<h3>Output:</h3>
|
|
<ul class="output"></ul>
|
|
</div>
|
|
<div class="demo-description">
|
|
<p>A controlgroup creating a split button, by combining a button and a selectmenu. We adjust the classes option on the selectmenu to show only the icon</p>
|
|
</div>
|
|
</body>
|
|
</html>
|