mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Button demo: Coding standards.
This commit is contained in:
parent
fb71ebad6a
commit
33fa0ce2b2
@ -11,6 +11,9 @@
|
|||||||
<script src="../../ui/jquery.ui.position.js"></script>
|
<script src="../../ui/jquery.ui.position.js"></script>
|
||||||
<script src="../../ui/jquery.ui.menu.js"></script>
|
<script src="../../ui/jquery.ui.menu.js"></script>
|
||||||
<link rel="stylesheet" href="../demos.css">
|
<link rel="stylesheet" href="../demos.css">
|
||||||
|
<style>
|
||||||
|
.ui-menu { position: absolute; width: 100px; }
|
||||||
|
</style>
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
$( "#rerun" )
|
$( "#rerun" )
|
||||||
@ -18,34 +21,31 @@
|
|||||||
.click(function() {
|
.click(function() {
|
||||||
alert( "Running the last action" );
|
alert( "Running the last action" );
|
||||||
})
|
})
|
||||||
.next()
|
.next()
|
||||||
.button( {
|
.button({
|
||||||
text: false,
|
text: false,
|
||||||
icons: {
|
icons: {
|
||||||
primary: "ui-icon-triangle-1-s"
|
primary: "ui-icon-triangle-1-s"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.click( function() {
|
.click(function() {
|
||||||
var menu = $(this).parent().next().show().position({
|
var menu = $( this ).parent().next().show().position({
|
||||||
my: "left top",
|
my: "left top",
|
||||||
at: "left bottom",
|
at: "left bottom",
|
||||||
of: this
|
of: this
|
||||||
});
|
});
|
||||||
$(document).one("click", function() {
|
$( document ).one( "click", function() {
|
||||||
menu.hide();
|
menu.hide();
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
})
|
})
|
||||||
.parent()
|
.parent()
|
||||||
.buttonset()
|
.buttonset()
|
||||||
.next()
|
.next()
|
||||||
.hide()
|
.hide()
|
||||||
.menu();
|
.menu();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style>
|
|
||||||
.ui-menu { position: absolute; width: 100px; }
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user