artDialog的使用

用法一:github上下载包:https://github.com/aui/artDialog
               seajs方法使用
               <!doctype html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>test</title>
    <style>
    body {
        *margin: 0;
        *padding: 0;
    }
    </style>
</head>
<body>
<button data-event="test">open dialog</button>
<script src="../lib/sea.js"></script>
<script>
seajs.config({
  alias: {
    "jquery": "jquery-1.10.2.js" //jquery路径
  }
});
seajs.use(['jquery', '../src/dialog-plus'], function ($, dialog) {
    $('button[data-event=test]').on('click', function () {
        var d = dialog({
            title: '消息',
            content: '风吹起的青色衣衫,夕阳里的温暖容颜,你比以前更加美丽,像盛开的花<br>——许巍《难忘的一天》',
            okValue: '确 定',
            ok: function () {
                var that = this;
                setTimeout(function () {
                    that.title('提交中..');
 
                }, 2000);
                return false;
            },
            cancelValue: '取消',
            cancel: function () {}
        });
       // d.show();
        d.showModal();//有遮罩层效果
    });
});
</script>
</body>
          </html>

  

 
用法二:下载artDialog插件包   但是没有d.showModal()
引入js  css使用
  
   <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" type="text/css" href="../artDialog/skins/idialog.css">
    <script type="text/javascript" src='../artDialog/artDialog.js'></script>
</head>
<body>
    <script type="text/javascript">
            var d = art.dialog({
               title: '提示信息',
            content: '风吹起的青色衣衫,夕阳里的温暖容颜,你比以前更加美丽,像盛开的花<br>——许巍《难忘的一天》',
            okValue: '确 定',
            ok: function () {
                var that = this;
                setTimeout(function () {
                    that.title('提交中..');
                }, 2000);
                return false;
            },
            cancelValue: '取消',
            cancel: function () {}
            });
             d.show();
            //d.showModal();//报错
    </script>;
</body>
</html>

  

 
posted @ 2016-08-05 15:46  lhy031  阅读(359)  评论(0编辑  收藏  举报