码迷,mamicode.com
首页 > 其他好文 > 详细

基于artDialog的扩展

时间:2016-10-24 09:25:55      阅读:145      评论:0      收藏:0      [点我收藏+]

标签:art   title   val   .sh   tip   log   out   tle   资源   

/*
*
* 引用此文件必须引用以下两个资源文件,并且还要引用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, width, height, close, isModal) {
        width = width || 500;
        height = height || 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, width, height, close, isModal) {
        title = title || "消息";
        isModal = isModal || true;

        var d = dialog({
            fixed: true,
            content: content,
            title: title,
            width: width,
            height: height,
            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;
    }
}

 

基于artDialog的扩展

标签:art   title   val   .sh   tip   log   out   tle   资源   

原文地址:http://www.cnblogs.com/Jarvan-Chan/p/5991735.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!