/**
* 警告
* @param {String}消息内容
*/
artDialog.alert = function (content, callback) {
return artDialog({
id: 'Alert',
icon: 'warning',
fixed: true,
// lock: true,
width:250,
height:50,
content: content,
ok: true,
close: callback
});
};
/**
* 确认
* @param {String}消息内容
* @param {Function}确定button回调函数
* @param {Function}取消button回调函数
*/
artDialog.confirm = function (content, yes, no) {
return artDialog({
id: 'Confirm',
icon: 'question',
fixed: true,
// lock: true,
opacity: .1,
width:250,
height:50,
content: content,
ok: function (here) {
return yes.call(this, here);
},
cancel: function (here) {
return no && no.call(this, here);
}
});
};
/**
* 提问
* @param {String}提问内容
* @param {Function}回调函数. 接收參数:输入值
* @param {String}默认值
*/
artDialog.prompt = function (content, yes, value) {
value = value || '';
var input; return artDialog({
id: 'Prompt',
icon: 'question',
fixed: true,
// lock: true,
width:250,
height:50,
opacity: .1,
content: [
'<div style="margin-bottom:5px;font-size:12px">',
content,
'</div>',
'<div>',
'<input value="',
value,
'" style="width:18em;padding:6px 4px" />',
'</div>'
].join(''),
init: function () {
input = this.DOM.content.find('input')[0];
input.select();
input.focus();
},
ok: function (here) {
return yes && yes.call(this, input.value, here);
},
cancel: true
});
};
/**
* 短暂提示
* @param {String}提示内容
* @param {Number}显示时间 (默认1.5秒)
*/
artDialog.tips = function (content, time) {
return artDialog({
id: 'Tips',
title: false,
cancel: false,
fixed: true,
// lock: true,
width:250,
height:50
})
.content('<div style="padding: 0 1em;">' + content + '</div>')
.time(time || 1);
};
//右下角滑动通知
artDialog.notice = function (options) {
var opt = options || {},
api, aConfig, hide, wrap, top,
duration = 800; var config = {
id: 'Notice',
left: '100%',
top: '100%',
fixed: true,
drag: false,
width:250,
height:50,
resize: false,
follow: null,
lock: false,
init: function(here){
api = this;
aConfig = api.config;
wrap = api.DOM.wrap;
top = parseInt(wrap[0].style.top);
hide = top + wrap[0].offsetHeight; wrap.css('top', hide + 'px')
.animate({top: top + 'px'}, duration, function () {
opt.init && opt.init.call(api, here);
});
},
close: function(here){
wrap.animate({top: hide + 'px'}, duration, function () {
opt.close && opt.close.call(this, here);
aConfig.close = $.noop;
api.close();
}); return false;
}
}; for (var i in opt) {
if (config[i] === undefined) config[i] = opt[i];
}; return artDialog(config);
};
//调用范例:
art.dialog.alert('人品越来越不那么稳定了,请检查!'); art.dialog.confirm('你确定要删除这掉消息吗?', function () {
art.dialog.tips('运行确定操作');
}, function () {
art.dialog.tips('运行取消操作');
}); art.dialog.prompt('请输入图片网址', function (val) {
art.dialog.tips(val);
}, 'http://'); art.dialog.tips('数据正在提交..', 2);
//[more code..]
art.dialog.tips('成功。已经保存在server');

artDialog提示框、对话框的更多相关文章

  1. artDialog提示框

    API网址 http://aui.github.io/artDialog/doc/index.html 相关资料下载 https://code.google.com/archive/p/artdial ...

  2. 如何在 messager/alert/confirm等消息提示框中 获取 / 设置 嵌入 html内容中的 input[type=checkbox]等的选中状态?

    总结, 有3点: 不能/不要 在 这些消息框 / 提示框/ 对话框中的 回调函数中去写代码: 获取嵌入 内容中input.checkbox的选中状态, 因为 虽然在这些框存在的时候, 这个 check ...

  3. js弹出框、对话框、提示框、弹窗总结

    一.JS的三种最常见的对话框 //====================== JS最常用三种弹出对话框 ======================== //弹出对话框并输出一段提示信息 funct ...

  4. 基于Metronic的Bootstrap开发框架经验总结(6)--对话框及提示框的处理和优化

    在各种Web开发过程中,对话框和提示框的处理是很常见的一种界面处理技术,用得好,可以给用户很好的页面体验,Bootstrap开发也一样,我们往往在页面新增.编辑.查看详细等界面使用弹出对话框层的方式进 ...

  5. jquery仿alert提示框、confirm确认对话框、prompt带输入的提示框插件[附实例演示]

    jquery仿alert提示框.confirm确认对话框.prompt带输入的提示框插件实例演示 第一步:引入所需要的jquery插件文件: http://www.angelweb.cn/Inc/eg ...

  6. form WebBrowser自动点击弹出提示框alert、弹出对话框confirm、屏蔽弹出框、屏蔽弹出脚本错误的解决办法

    针对WebBrowser控件中自动点击弹出框及禁用脚本提示问题得到如下几种实际情况的解决办法,绝对管用. 1.屏蔽弹出错误脚本 将WebBrowser控件ScriptErrorsSuppressed设 ...

  7. Android开发 ---构建对话框Builder对象,消息提示框、列表对话框、单选提示框、多选提示框、日期/时间对话框、进度条对话框、自定义对话框、投影

    效果图: 1.activity_main.xml 描述: a.定义了一个消息提示框按钮 点击按钮弹出消息 b.定义了一个选择城市的输入框 点击按钮选择城市 c.定义了一个单选提示框按钮 点击按钮选择某 ...

  8. 经验总结:WebBrowser自动点击弹出提示框alert、弹出对话框confirm、屏蔽弹出框、屏蔽弹出脚本错误的解决办法

    经验总结:WebBrowser自动点击弹出提示框alert.弹出对话框confirm.屏蔽弹出框.屏蔽弹出脚本错误的解决办法 网上有好多解决方法,可是不一定好使,本人经过多次试验,针对WebBrows ...

  9. bootstrap dialog对话框,完成操作提示框

    1. 依赖文件: bootstrap.js bootstrap-dialog.js bootstrap.css bootstrap-dialog.css 2.代码 BootstrapDialog.co ...

随机推荐

  1. [POI2008]PLA-Postering(单调栈)

    题意 N个矩形,排成一排. 现在希望用尽量少的矩形海报Cover住它们. (n<=250000,wi,di<=109) 题解 这种一堆矩形,又不像数据结构的题,一般都是单调栈. 考虑一个贪 ...

  2. Laravel核心解读--HTTP内核

    Http Kernel Http Kernel是Laravel中用来串联框架的各个核心组件来网络请求的,简单的说只要是通过public/index.php来启动框架的都会用到Http Kernel,而 ...

  3. vscode 问题

    *)不能切换为中文输入法 没有搜索到解决办法,重启应用解决

  4. [USACO5.4]奶牛的电信Telecowmunication(网络流)

    P1345 [USACO5.4]奶牛的电信Telecowmunication 题目描述 农夫约翰的奶牛们喜欢通过电邮保持联系,于是她们建立了一个奶牛电脑网络,以便互相交流.这些机器用如下的方式发送电邮 ...

  5. Oracle基础入门(三)

    一:PLsql一些基本操作 调节plsql的字体大小 二:创建表,如果学过sql server的数据库就会发现其实Oracle跟的一些新建表和新增修改其实是差不多的 新建表 Create table ...

  6. 给一个执行在windows 7和NAT下的VMWARE虚拟机分配固定IP

    虚拟机上装了个oracleserver,每次vmware重新启动或者resume时总要分配新的IP地址,这样就得改动windows下的client配置,所以须要想办法把IP地址固定住. DHCP服务在 ...

  7. 2016届 阿里巴巴校招研发project师C/C++笔试题--2015.08.23

    选择题牛客网地址题目1:http://www.nowcoder.com/test/255234/summary. 题目2:http://www.nowcoder.com/test/262758/sum ...

  8. 同学们,OpenCV出3.0了,速去围观!

    OpenCV3.0 OpenCV > NEWS > OpenCV 3.0 2015-06-04 With a great pleasure and great relief OpenCV ...

  9. BOOST_CLASS_EXPORT

    用基类的指针去转存派生类时除了上一篇boost::serialization 用基类指针转存派生类(错误多多,一波三折)之外.还有还有一种更简单的方法: 用BOOST_CLASS_EXPORT宏. 以 ...

  10. ajax处理错误(六)

    使用ajax时必须留心两类错误,他们之间的区别源于视角不同. 一.第一类错误是从XMLHttpRequest对象的角度看到的问题:某些因素阻例如止了请求发送到服务器,例如DNS无法解析主机名,连接请求 ...