68 lines
3.1 KiB
HTML
68 lines
3.1 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<title>Hello World Dialog Example</title>
|
|
<!-- YAHOO UI Utilities Lib, you will need to replace this with the path to your YUI lib file -->
|
|
<script type="text/javascript" src="http://us.js2.yimg.com/us.js.yimg.com/lib/common/utils/2/utilities_2.1.0.js"></script>
|
|
<script type="text/javascript" src="../../yui-ext.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="../../resources/css/reset-min.css" />
|
|
<link rel="stylesheet" type="text/css" href="../../resources/css/resizable.css" />
|
|
<link rel="stylesheet" type="text/css" href="../../resources/css/tabs.css" />
|
|
<link rel="stylesheet" type="text/css" href="../../resources/css/basic-dialog.css" />
|
|
|
|
<script language="javascript" src="hello.js"></script>
|
|
|
|
<!-- Common Styles for the examples -->
|
|
<link rel="stylesheet" type="text/css" href="../examples.css" />
|
|
</head>
|
|
|
|
<body>
|
|
<div class="example-info">
|
|
To view the source of this page, right click (Mac users control+click) in this frame and select "View Source" or "This Frame"->"View Source".
|
|
</div>
|
|
<h1>Hello World Dialog</h1>
|
|
<p>This example shows how to create a very simple modal BasicDialog with "autoTabs".</p>
|
|
<input type="button" id="show-dialog-btn" value="Hello World" /><br /><br />
|
|
<div style="background:#F8F8F8;padding:10px;margin:10px;margin-left:0px;border:1px solid #e8e8e8;border-left:4px solid #e8e8e8;">This example and the gray theme were sponsored by Dharmesh Shah of <a href="http://onstartups.com/">http://onstartups.com/</a>. Thanks Dharmesh!</div>
|
|
<p>Note that the js is not minified so it is readable. See <a href="hello.js">hellos.js</a> for the full source code.</p>
|
|
Here's snapshot of the code that creates the dialog:
|
|
<pre class="code"><code>dialog = new YAHOO.ext.BasicDialog("hello-dlg", {
|
|
modal:true,
|
|
autoTabs:true,
|
|
width:500,
|
|
height:300,
|
|
shadow:true,
|
|
minWidth:300,
|
|
minHeight:300
|
|
});
|
|
dialog.addKeyListener(27, dialog.hide, dialog);
|
|
dialog.addButton('Close', dialog.hide, dialog);
|
|
dialog.addButton('Submit', dialog.hide, dialog).disable();
|
|
</code></pre>
|
|
|
|
<!-- The dialog is created from existing markup.
|
|
The inline styles just hide it until it created and should be in a stylesheet -->
|
|
<div id="hello-dlg" style="visibility:hidden;position:absolute;top:0px;">
|
|
<div class="ydlg-hd">Hello Dialog</div>
|
|
<div class="ydlg-bd">
|
|
<!-- Auto create tab 1 -->
|
|
<div class="ydlg-tab" title="Hello World 1">
|
|
<!-- Nested "inner-tab" to safely add padding -->
|
|
<div class="inner-tab">
|
|
Hello...<br><br><br>
|
|
<input type="button" id="theme-btn" value="Toggle Theme" />
|
|
</div>
|
|
</div>
|
|
<!-- Auto create tab 2 -->
|
|
<div class="ydlg-tab" title="Hello World 2">
|
|
<div class="inner-tab">
|
|
... World!
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|