artDialog ( v 6.0.2 ) content 參數引入頁面 html 內容

來源:互聯網
上載者:User

標籤:

/*! artDialog v6.0.2 | https://github.com/aui/artDialog */

將頁面某一隱藏的 div 的 html 內容傳到 artdialog 的彈窗中,並且該 div 不會被刪除,代碼如下:

<!DOCTYPE html><html><head><meta charset="utf-8"><script src="lib/jquery-1.10.2.js"></script><link rel="stylesheet" href="css/ui-dialog.css"><script src="dist/dialog-min.js"></script></head>
<body><div id="con" style="display:none">test</div><input type="button" value="點我" id="btn"></body><script> var con = document.getElementById(‘con‘); $(‘#btn‘).on(‘click‘, function () { $("#con").attr("style","display:block"); var d = dialog({ title: ‘訊息‘, width: 500, }); d.show(); d.content(con); });</script></html>

 

參考資料:

https://github.com/aui/artDialog/wiki/artDialog-v5%E5%8D%87%E7%BA%A7v6%E5%8F%82%E8%80%83 artDialog v6是一個全新的版本,由於修改幅度非常大,以下變更特性僅供參考(第7條):

content 參數傳入元素後不再自動顯示隱藏元素,並且關閉對話方塊不再自動插入原來的位置,而是隨著對話方塊刪除。請用變數儲存好元素的引用,以便下次對話方塊能傳入該元素。

artDialog ( v 6.0.2 ) content 參數引入頁面 html 內容

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.