惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
S
Secure Thoughts
S
Schneier on Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Cyberwarzone
Cyberwarzone
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Privacy International News Feed
L
Lohrmann on Cybersecurity
Schneier on Security
Schneier on Security
PCI Perspectives
PCI Perspectives
Google DeepMind News
Google DeepMind News
C
Cybersecurity and Infrastructure Security Agency CISA
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Latest news
Latest news
H
Hacker News: Front Page
月光博客
月光博客
Forbes - Security
Forbes - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
Security @ Cisco Blogs
WordPress大学
WordPress大学
Recent Commits to openclaw:main
Recent Commits to openclaw:main
aimingoo的专栏
aimingoo的专栏
宝玉的分享
宝玉的分享
D
Docker
U
Unit 42
Recorded Future
Recorded Future
Spread Privacy
Spread Privacy
Microsoft Security Blog
Microsoft Security Blog
Recent Announcements
Recent Announcements
云风的 BLOG
云风的 BLOG
Application and Cybersecurity Blog
Application and Cybersecurity Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Heimdal Security Blog
Microsoft Azure Blog
Microsoft Azure Blog
V
Vulnerabilities – Threatpost
Vercel News
Vercel News
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
爱范儿
爱范儿
博客园 - 聂微东
Hugging Face - Blog
Hugging Face - Blog
L
LangChain Blog
G
GRAHAM CLULEY
Apple Machine Learning Research
Apple Machine Learning Research
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Blog — PlanetScale
Blog — PlanetScale
博客园 - 三生石上(FineUI控件)
罗磊的独立博客
Help Net Security
Help Net Security
Google Online Security Blog
Google Online Security Blog
S
SegmentFault 最新的问题

博客园 - sunfishlu

一步一步学习Windows Azure(二)Azure之Hello World 一步一步学习Windows Azure(一)概述 一步一步学习CakePHP(三)model 一步一步学习CakePHP(二)controllers 一步一步学习CakePHP(一)基本概念 JQuery写的个性导航菜单 - sunfishlu - 博客园 JQueryUI(四):Dialog(第一部分) - sunfishlu - 博客园 JQueryUI(三):Accordion JQueryUI(二):Tabs(第二部分) JQueryUI(一):Tabs(第一部分) - sunfishlu - 博客园 封装的Ext Grid javascript与dom编程(五)ajax 无法在Web服务器上启动调试。您不具备调试此应用程序的权限,此项目的URL位于Internet区域。 - sunfishlu - 博客园 ToolTip(图片文字) with Jquery Ext中combobox在Grid里显示问题 javascript与dom编程(四)animation(例)Tooltips javascript与dom编程(三)animation extjs grid设置某列背景颜色 javascript与dom编程(二)Event
JQueryUI(五):Dialog(第二部分)
sunfishlu · 2009-09-28 · via 博客园 - sunfishlu

3:事件

3.1:close,关闭对话框时执行

3.2:drag,拖动对话框时执行

3.3:dragStart,开始拖动对话框时执行

3.4:dragStop,结束拖动对话框时执行

3.5:focus,对话框获得焦点时执行

3.6:open,打开对话框时执行

3.7:resize,调整对话框大小时执行

3.8:resizeStart/resizeStop,开始、结束调整对话框大小时执行

3.9:beforeclose,对话框关闭前执行。

    <script type="text/javascript">
            $(document).ready(function () {
                var dialogOpts = {
                    open: function(){
                        $("#status").text("The dislog is open");
                    },
                    close: function(){
                        $("#status").text("The dialog is closed");
                    }
                };
               $("#myDialog").dialog(dialogOpts);
            });
    </script>

4:方法

4.1:close,关闭对话框。.dialog(“close”);

4.2:destroy,销毁。$("#destroy").dialog("destroy");

4.3:isOpen,对话框可见时返回true。

4.4:moveToTop,使对话框处于最前方。

4.5:open,显示对话框。$("#myDialog").dialog("open");

5:从对话框获取数据

因为对话框是页面的一个部件,所以要从对话框获取数据非常容易,对话框和页面上别的元素一样,例:

<!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>A basic dialog</title>
    <link href="../css/redmond/jquery-ui.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../css/redmond/ui.dialog.css" />
    <script type="text/javascript" src="../jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="../ui/ui.core.js"></script>
    <script type="text/javascript" src="../ui/ui.dialog.js"></script>
    <script type="text/javascript" src="../ui/ui.draggable.js"></script>
    <script type="text/javascript" src="../ui/ui.resizable.js"></script>

    <script type="text/javascript">
        $(function(){
            var cancel = function() {
                $("#myDialog").dialog("close");
            }
            var getResponse = function(){
                var answer;
                $("input").each(function(){
                    (this.checked == true) ? answer = $(this).val() : null;
                });
                $("<p>").text("Thanks for selecting " + answer)
                .insertAfter($("#poll"));
                $("#myDialog").dialog("close");
            }

            var dialogOpts = {
                modal: true,
                overlay: {
                background: "url(img/modal.png) repeat"
                },
                buttons: {
                "Done": getResponse,
                "Cancel": cancel
                },
                autoOpen: false
            };

            $("#myDialog").dialog(dialogOpts);

            $("#poll").click(function() {
                $("#myDialog").dialog("open");
            });
        });
    </script>

    <style type="text/css">
        body
        {
            font: 62.5% "Trebuchet MS" , sans-serif;
            margin: 10px;
        }
    </style>
</head>
<body>
    <p>
        Answer the opinion poll:</p>
    <button id="poll">
        Poll</button>
    <div id="myDialog" class="flora" title="This is the title">
        <p>
            Is jQuery UI the greatest JavaScript extensions library in the universe?</p>
        <label for="yes">
            Yes!</label><input type="radio" id="yes" value="yes" name="question"><br>
        <label for="no">
            No!</label><input type="radio" id="no" value="no" name="question">
    </div>
</body>
</html>

效果图:

DEJ9F60KNX@I857FTV$05$8