|
10 | 10 | <script type="text/javascript" src="../../ui/jquery.ui.tooltip.js"></script>
|
11 | 11 | <script type="text/javascript" src="../../ui/jquery.ui.button.js"></script>
|
12 | 12 | <script type="text/javascript" src="../../ui/jquery.ui.menu.js"></script>
|
| 13 | + <script type="text/javascript" src="../../ui/jquery.effects.core.js"></script> |
| 14 | + <script type="text/javascript" src="../../ui/jquery.effects.blind.js"></script> |
13 | 15 | <script type="text/javascript" src="../../tests/visual/menu/popup.js"></script>
|
14 | 16 | <link type="text/css" href="../demos.css" rel="stylesheet" />
|
15 | 17 | <script type="text/javascript">
|
16 | 18 | $(function() {
|
17 | 19 | function notify( input ) {
|
18 | 20 | var msg = "Selected " + $.trim($(input).text());
|
19 |
| - $("<div/>").appendTo(document.body).text(msg).addClass("notification ui-state-highlight").position({ |
20 |
| - my: "center top+20", |
| 21 | + $("<div/>").appendTo(document.body).text(msg).addClass("notification ui-state-default ui-corner-bottom").position({ |
| 22 | + my: "center top", |
21 | 23 | at: "center top",
|
22 | 24 | of: window
|
23 |
| - }).delay(1000).fadeOut("slow", function() { |
| 25 | + }).show({ |
| 26 | + effect: "blind" |
| 27 | + }).delay(1000).hide({ |
| 28 | + effect: "blind", |
| 29 | + duration: "slow" |
| 30 | + }, function() { |
24 | 31 | $(this).remove();
|
25 | 32 | });
|
26 | 33 | }
|
27 | 34 | $("ul").menu({
|
28 | 35 | select: function(event, ui) {
|
29 |
| - // stop button from handling the click |
| 36 | + // TODO stop button from handling the click |
30 | 37 | $(this).popup("close");
|
| 38 | + // TODO should probably be handled by poup, see ESCAPE key handler |
| 39 | + // affects key handling |
| 40 | + $(this).prev().focus(); |
31 | 41 | notify(ui.item);
|
32 | 42 | }
|
33 | 43 | }).popup();
|
|
75 | 85 |
|
76 | 86 | .set { display: inline-block; }
|
77 | 87 |
|
78 |
| - .notification { position: absolute; display: inline-block; font-size: 2em; padding: 1em; border-radius: 15px; box-shadow: 2px 2px 5px -2px rgba(0,0,0,0.5); } |
| 88 | + .notification { position: absolute; display: inline-block; font-size: 2em; padding: .5em; box-shadow: 2px 2px 5px -2px rgba(0,0,0,0.5); } |
79 | 89 | </style>
|
80 | 90 | </head>
|
81 | 91 | <body>
|
|
0 commit comments