|
| 1 | +<!doctype html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <title>jQuery UI Dialog - Default functionality</title> |
| 6 | + <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css"> |
| 7 | + <script src="../../jquery-1.8.2.js"></script> |
| 8 | + <script src="../../external/jquery.bgiframe-2.1.2.js"></script> |
| 9 | + <script src="../../ui/jquery.ui.core.js"></script> |
| 10 | + <script src="../../ui/jquery.ui.widget.js"></script> |
| 11 | + <script src="../../ui/jquery.ui.mouse.js"></script> |
| 12 | + <script src="../../ui/jquery.ui.draggable.js"></script> |
| 13 | + <script src="../../ui/jquery.ui.position.js"></script> |
| 14 | + <script src="../../ui/jquery.ui.resizable.js"></script> |
| 15 | + <script src="../../ui/jquery.ui.dialog.js"></script> |
| 16 | + |
| 17 | + <!-- stuff needed to make things complex --> |
| 18 | + <script src="../../ui/jquery.ui.datepicker.js"></script> |
| 19 | + <script src="../../ui/jquery.ui.menu.js"></script> |
| 20 | + <script src="../../ui/jquery.ui.autocomplete.js"></script> |
| 21 | + <script src="../../ui/jquery.ui.tooltip.js"></script> |
| 22 | + |
| 23 | + <link rel="stylesheet" href="../demos.css"> |
| 24 | + <script> |
| 25 | + $(function() { |
| 26 | + $( "#dialog" ).dialog({ |
| 27 | + modal: true, |
| 28 | + height: 300, |
| 29 | + width: 500 |
| 30 | + }); |
| 31 | + |
| 32 | + var $datepicker = $( "#dialog-datepicker" ).dialog({ |
| 33 | + //appendTo: '.demo-description', |
| 34 | + //appendTo: $('.demo-description'), |
| 35 | + autoOpen: false, |
| 36 | + modal: true, |
| 37 | + }); |
| 38 | + |
| 39 | + var $autocomplete = $( "#dialog-autocomplete" ).dialog({ |
| 40 | + //appendTo: '.demo-description', |
| 41 | + //appendTo: $('.demo-description'), |
| 42 | + autoOpen: false, |
| 43 | + modal: true, |
| 44 | + width: 600 |
| 45 | + }); |
| 46 | + |
| 47 | + $('#open-datepicker').click(function(event) { |
| 48 | + event.preventDefault(); |
| 49 | + $datepicker.dialog('open'); |
| 50 | + }); |
| 51 | + |
| 52 | + $('#open-autocomplete').click(function(event) { |
| 53 | + event.preventDefault(); |
| 54 | + $autocomplete.dialog('open'); |
| 55 | + }); |
| 56 | + |
| 57 | + $( "#datepicker" ).datepicker(); |
| 58 | + |
| 59 | + var availableTags = [ |
| 60 | + "ActionScript", |
| 61 | + "AppleScript", |
| 62 | + "Asp", |
| 63 | + "BASIC", |
| 64 | + "C", |
| 65 | + "C++", |
| 66 | + "Clojure", |
| 67 | + "COBOL", |
| 68 | + "ColdFusion", |
| 69 | + "Erlang", |
| 70 | + "Fortran", |
| 71 | + "Groovy", |
| 72 | + "Haskell", |
| 73 | + "Java", |
| 74 | + "JavaScript", |
| 75 | + "Lisp", |
| 76 | + "Perl", |
| 77 | + "PHP", |
| 78 | + "Python", |
| 79 | + "Ruby", |
| 80 | + "Scala", |
| 81 | + "Scheme" |
| 82 | + ]; |
| 83 | + $( "#tags" ).autocomplete({ |
| 84 | + source: availableTags |
| 85 | + }); |
| 86 | + |
| 87 | + $( document ).tooltip(); |
| 88 | + }); |
| 89 | + </script> |
| 90 | +</head> |
| 91 | +<body> |
| 92 | + |
| 93 | +<div id="dialog" title="Basic dialog"> |
| 94 | + <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> |
| 95 | + <p><a href="#" id="open-datepicker">Open another window with a datepicker.</a></p> |
| 96 | +</div> |
| 97 | + |
| 98 | +<div id="dialog-datepicker" title="A dialog with a datepicker"> |
| 99 | + <p>Date: <input type="text" id="datepicker" /></p> |
| 100 | + <p><a href="#" id="open-autocomplete">Open another window with an autocomplete and a tooltip.</a></p> |
| 101 | +</div> |
| 102 | + |
| 103 | +<div id="dialog-autocomplete"> |
| 104 | + <label for="tags">Tags: </label> |
| 105 | + <input id="tags" title="Try typing something!" /> |
| 106 | +</div> |
| 107 | +<div class="demo-description"> |
| 108 | +<p>The basic dialog window is an overlay positioned within the viewport and is protected from page content (like select elements) shining through with an iframe. It has a title bar and a content area, and can be moved, resized and closed with the 'x' icon by default.</p> |
| 109 | + |
| 110 | +</div> |
| 111 | +</body> |
| 112 | +</html> |
0 commit comments