EasyUI建立對話方塊的兩種方式,easyui建立兩種方式

來源:互聯網
上載者:User

EasyUI建立對話方塊的兩種方式,easyui建立兩種方式

對話方塊(Dialog)是一個特殊的視窗(window),可以包含在頂部的工具列和在底部的按鈕。預設情況下,對話方塊(Dialog)不能改變大小,但是使用者可以設定 resizable 屬性為 true,使其可以改變大小。

這種就是對話方塊了。

EasyUI有兩種建立方式:

第一種:通過已存在的DOM節點元素標籤建立

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>無標題文檔</title><!-- 匯入js檔案 --><!-- 匯入jquery核心js檔案 --><script type="text/javascript" src="jquery.min.js"></script><!-- 匯入easyui核心js檔案 --><script type="text/javascript" src="jquery.easyui.min.js"></script><!-- 匯入本地語言的js檔案--><script type="text/javascript" src="locale/easyui-lang-zh_CN.js"></script><!-- 匯入css --><!-- 匯入easyui的預設css檔案--><link type="text/css" rel="stylesheet" href="themes/default/easyui.css"/><!-- 匯入表徵圖的css檔案 --><link type="text/css" rel="stylesheet" href="themes/icon.css"/></head><body><div id="dd" class="easyui-dialog" title="我的對話方塊" style="width:400px;height:200px;" data-options="iconCls:'icon-save',resizable:true,modal:true"> 提示內容</div> </body></html>

第二種:通過js動態建立對話方塊

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>無標題文檔</title><!-- 匯入js檔案 --><!-- 匯入jquery核心js檔案 --><script type="text/javascript" src="jquery.min.js"></script><!-- 匯入easyui核心js檔案 --><script type="text/javascript" src="jquery.easyui.min.js"></script><!-- 匯入本地語言的js檔案--><script type="text/javascript" src="locale/easyui-lang-zh_CN.js"></script><!-- 匯入css --><!-- 匯入easyui的預設css檔案--><link type="text/css" rel="stylesheet" href="themes/default/easyui.css"/><!-- 匯入表徵圖的css檔案 --><link type="text/css" rel="stylesheet" href="themes/icon.css"/></head><body><!--<div id="dd" class="easyui-dialog" title="我的對話方塊" style="width:400px;height:200px;" data-options="iconCls:'icon-save',resizable:true,modal:true"> 提示內容</div> --> <div id="dd">對話方塊內容</div><script type="text/javascript">$("#dd").dialog({title: '我的對話方塊', //標題collapsible:true, //是否可摺疊minimizable:true, //最小化按鈕maximizable:true,//最大化按鈕resizable:true,//是否改變視窗大小width: 400, height: 200, closed: false, cache: false, href: 'beautiful.html', });</script></body></html>

以上所述是小編給大家介紹的EasyUI建立對話方塊的兩種方式,希望對大家有所協助,如果大家有任何疑問請給我留言,小編會及時回複大家的。在此也非常感謝大家對幫客之家網站的支援!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.