基于artDialog的扩展

/*
*
* 引用此文件必须引用以下两个资源文件,并且还要引用jQuery
* <link href="ui-dialog.css" rel="stylesheet" type="text/css"/>
* <script type="text/javascript" src="dialog-plus-min.js"></script>
*
*/

 

var myDialog = {
    showTips: function(content, title, showTime, close, isModal) {
        title = title || "消息";
        isModal = isModal || true;
        var d = dialog({
            fixed: true,
            title: title,
            content: content,
            onclose: close
        });

        if (isModal) {
            d.showModal();
        }
        else {
            d.show();
        }

        if (showTime > 0) {
            setTimeout(function() { d.close().remove(); }, showTime);
        }

        return d;
    },
    openWindow: function(url, title, height, width, close, isModal) {
        height = height || 500;         
        width = width || 500;
        isModal = isModal || true;

        var iframe = $('<iframe/>', { src: url });
        iframe.css('width', width);
        iframe.css('height', height);
        var d = dialog({
            fixed: true,
            title: title,
            content: iframe,
            onclose: close
        });

        if (isModal) {
            d.showModal();
        }
        else {
            d.show();
        }

        return d;
    },
    openDialog: function(content, title, height, width, close, isModal) {
        title = title || "消息";
        height = height || 500;
        width = width || 500;
        isModal = isModal || true;

        var d = dialog({
            fixed: true,
            content: content,
            title: title,
            height: height,
            width: width,
            onclose: close
        });

        if (isModal) {
            d.showModal();
        }
        else {
            d.show();
        }
        return d;
    },
    openConfirm: function(content, title, ok, cancel, close) {
        title = title || "消息";

        var d = dialog({
            fixed: true,
            title: title,
            content: content,
            okValue: '确定',
            ok: ok,
            cancelValue: '取消',
            cancel: cancel,
            onclose: close
        });
        d.showModal();

        return d;
    }
}

 

转载于:https://www.cnblogs.com/Jarvan-Chan/p/5991735.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值