使用artDialog创建各种炫酷弹出框
来源:互联网 发布:大数据与云计算知乎 编辑:程序博客网 时间:2024/06/05 13:29
artDialog4.x版本下载地址在这里:http://www.daimajiayuan.com/download/201304/yulan/artDialog4.1.7/index.html
artDialog5.x版本下载地址在这里:https://github.com/aui/artDialog
artDialog是一个基于javascript编写的对话框组件,它拥有精致的界面与友好的接口
今天我给大家就简单演示几个大家常用的。
摇头效果
类似与wordpress登录失败后登录框可爱的左右晃动效果
// 2011-07-17 更新artDialog.fn.shake = function (){ var style = this.DOM.wrap[0].style, p = [4, 8, 4, 0, -4, -8, -4, 0], fx = function () { style.marginLeft = p.shift() + 'px'; if (p.length <= 0) { style.marginLeft = 0; clearInterval(timerId); }; }; p = p.concat(p.concat(p)); timerId = setInterval(fx, 13); return this;};
var dialog = art.dialog({ content: '<p>"己所不欲"下一句是?</p>' + '<input id="demo-labs-input" style="width:15em; padding:4px" />', fixed: true, id: 'Fm7', icon: 'question', okVal: '回答', ok: function () { var input = document.getElementById('demo-labs-input'); if (input.value !== '\u52ff\u65bd\u4e8e\u4eba') { this.shake && this.shake();// 调用抖动接口 input.select(); input.focus(); return false; } else { art.dialog({ content: '恭喜你,回答正确!', icon: 'succeed', fixed: true, lock: true, time: 1.5 }); }; }, cancel: true});dialog.shake && dialog.shake();// 调用抖动接口
右下角滑动通知
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, 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('成功!已经保存在服务器');
以上演示及核心内容,均摘自官网。你也可以忽略笨博客,直接前往官方网站。
0 0
- 使用artDialog创建各种炫酷弹出框
- artDialog弹出框使用
- artdialog弹出框
- 开源弹出框--artDialog
- asp.net表单验证和弹出框artDialog使用分享(资源整合)
- artDialog使用
- artDialog使用
- Jquery弹出层artDialog
- 关闭artdialog弹出窗口
- artDiaLog弹出插件
- 解决artDialog弹出artDialog的问题
- artDialog弹出框页面,ie7下错位解决办法
- 实用插件(五)弹出操作提示框artdialog
- ztree + artdialog,弹出树思路
- ArtDialog简单使用示例
- artDialog的使用笔记
- artDialog的使用
- artDialog基本使用
- EJB3.0介绍
- maven搭建ssm项目
- java程序性能优化
- 创新实训5.11 Python爬虫学习
- python+selenium自动化测试环境搭建
- 使用artDialog创建各种炫酷弹出框
- node.js开发网站直接提交留言到固定邮箱
- CLion中使用CMake导入第三方库的方法
- 搭建keepalived+lvs 模式,简单笔记
- 基于海思媒体库视频H264打包成RTP包
- 用[@[] mutableCopy]创建NSMutableArray,但未必好
- fatal error LNK1112: 模块计算机类型“X64”与目标计算机类型“x86”冲突_(解决方案)
- 一个将要完蛋的老程序员对年轻程序员的忠告
- redis可视化操作工具--redisdesktopmanager