jQuery插件artDialog.js使用与关闭方法示例


Posted in jQuery onOctober 09, 2017

本文实例讲述了jQuery插件artDialog.js使用与关闭方法。分享给大家供大家参考,具体如下:

子窗口关闭artdialog终极解决方案:

window.parent.window.art.dialog({ id: 'qin123' }).close();
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title>art</title>
 <link id="artDialogSkin" href="skins/default.css" rel="external nofollow" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="artDialog.js"></script>
<script type="text/javascript" src="plugins/iframeTools.js"></script> <!-- 对iframe的新工具 -->
</head>
<body >
<script type="text/javascript">
 function a(){
    art.dialog({content:'hello world!历史'})
    }
 function b(){
  art.dialog(
  {
   content:'欢迎你来到对话框世界!',
   lock:true,
   style:'succeed noClose'
  },
  function(){
   alert('你点了确定'); //不管点了确定还是取消默认都会关闭artdialog,除非在这里面返回false
  },
  function(){
   alert('你点了取消');
  }
     );
    }
 function c(){
 art.dialog(
 {
 title:'图片查看',
 fixed:true,
  content:'<img width="817" height="479" src="butterfly.jpg" />'
     });
 //return false;
 };
 function d(){
 // art.dialog({title:'dialog内嵌iframe', iframe:'http://www.baidu.com', width:'900', height:'500'});
 //已经没有了直接的iframe属性 通过下面的方式内嵌iframe 第二种效果不佳
 art.dialog.open("http://www.baidu.com", {width: 320, height: 400});
 // art.dialog({title:'dialog内嵌iframe', width:'900px',height:'500px', content:"<iframe align='right' src='http://www.baidu.com' width:'100%' height:'100%' />"});
 return false;
 };
 function e(){
 art.dialog(
 {
 title:'动画',
 fixed:true,
  content:'<embed src="ddd.rm" type="audio/x-pn-realaudio-plugin" autostart="true" width="420" height="363"></embed>'
     });
 }; //播放avi总是只有声音,没有画面,哎!
function f(){
 art.dialog({content:'你人品稳定么?', fixed:true, yesText:'我很稳定', style:'confirm', id:'bnt4_test'},
 function(){
   art.dialog({id:'bnt4_test'}).content('你骗人!');
   return false;//这样对话框才不会关闭
  },
  function(){alert('你是坏人');}//按右上角的叉关闭对话框也会执行这个函数
  );
 };
 function g(){
 art.dialog({mouse:true, id:'dg_test34243', content:'您收到 <strong>2</strong> 条消息',left:'right',width:'15em', top:'bottom', fixed:true});
 };
 function h(){
 art.dialog({id:'dg_test34243'}).close();
 };
 function i(){
  var _this = document.getElementById('btn7');
  if (document.getElementById('menu_4834783')) {//如果已经打开了对话框,按这个按钮还能把它关闭
  art.dialog({id:'menu_4834783'}).close();
  _this.innerHTML = '弹出菜单'; //button上显示的内容
  return;
  };
 art.dialog({id:'menu_4834783', title:'菜单', content:'请输入:<input style="width:200px;" id="M_dfd" type="text" value="hello world!" />',
  button:[{name:'确定',callback:function(){
    var a=document.getElementById('M_dfd').value;
    art.dialog({content:a, lock:true, time:1});
    }
  },
  {name:'关闭我',callback:function(){_this.innerHTML = '弹出菜单';}}
  ]
  }
  );
 _this.innerHTML = '关闭菜单';
 return false;
 };
 </script>
<input type="button" style="width: 100px" onClick="a()" value="最简单的对话框"/><br/>
<button id="btn0" onClick="b()">基本示例</button><br/>
<button id="btn1" onClick="c()">显示图片</button><br/>
<button id="btn2" onClick="d()">外部页面</button><br/>
<button id="btn3" onClick="e()">视频</button><br/>
<button id="btn4" onClick="f()">询问</button><br/>
<button id="btn5" onClick="g()">广告</button>
<button id="btn6" onClick="h()">关闭</button><br/>
<button id="btn7" onClick="i()">弹出菜单</button><br/>
</body>
</html>

artDialog_v4.1.7点击此处本站下载

希望本文所述对大家jQuery程序设计有所帮助。

jQuery 相关文章推荐
jquery.form.js异步提交表单详解
Apr 25 jQuery
jQuery+C#实现参数RSA加密传输功能【附jsencrypt.js下载】
Jun 26 jQuery
jQuery实现动态给table赋值的方法示例
Jul 04 jQuery
jquery.validate.js 多个相同name的处理方式
Jul 10 jQuery
jQuery实现的form转json经典示例
Oct 10 jQuery
jQuery实现右侧抽屉式在线客服功能
Dec 25 jQuery
jQuery图片查看插件Magnify开发详解
Dec 25 jQuery
用jquery获取select标签中选中的option值及文本的示例
Jan 25 jQuery
Jquery和CSS实现选择框重置按钮功能
Nov 08 jQuery
详解jQuery获取特殊属性的值以及设置内容
Nov 14 jQuery
jQuery中DOM操作原则实例分析
Aug 01 jQuery
使用jQuery实现掷骰子游戏
Oct 24 jQuery
jQuery实现html双向绑定功能示例
Oct 09 #jQuery
jqueryUI tab标签页代码分享
Oct 09 #jQuery
jQuery ajax调用webservice注意事项
Oct 08 #jQuery
jQuery完成表单验证的实例代码(纯代码)
Sep 30 #jQuery
jquery之基本选择器practice(实例讲解)
Sep 30 #jQuery
jquery鼠标悬停导航下划线滑出效果
Sep 29 #jQuery
jQuery选择器之子元素过滤选择器
Sep 28 #jQuery
You might like
PHP调用MySQL存储过程并返回值的方法
2014/12/26 PHP
php线性表的入栈与出栈实例分析
2015/06/12 PHP
64位windows系统下安装Memcache缓存
2015/12/06 PHP
YII Framework框架教程之日志用法详解
2016/03/14 PHP
jQuery的animate函数学习记录
2014/08/08 Javascript
javascript使用smipleChart实现简单图表
2015/01/02 Javascript
js实现索引图片切换效果
2015/11/21 Javascript
实例剖析AngularJS框架中数据的双向绑定运用
2016/03/04 Javascript
jQuery前端开发35个小技巧
2016/05/24 Javascript
js选项卡的制作方法
2017/01/23 Javascript
Vue2.0如何发布项目实战
2017/07/27 Javascript
JavaScript模板引擎应用场景及实现原理详解
2018/12/14 Javascript
微信实现自动跳转到用其他浏览器打开指定APP下载
2019/02/15 Javascript
vue.config.js中配置Vue的路径别名的方法
2020/02/11 Javascript
JavaScript实现简单进度条效果
2020/03/25 Javascript
Python bsddb模块操作Berkeley DB数据库介绍
2015/04/08 Python
Python函数式编程指南(四):生成器详解
2015/06/24 Python
在Mac OS上使用mod_wsgi连接Python与Apache服务器
2015/12/24 Python
Python 实现数据库更新脚本的生成方法
2017/07/09 Python
基于Python代码编辑器的选用(详解)
2017/09/13 Python
python 读取txt中每行数据,并且保存到excel中的实例
2018/04/29 Python
《与孩子一起学编程》python自测题
2018/05/27 Python
Python决策树之基于信息增益的特征选择示例
2018/06/25 Python
Python中几种属性访问的区别与用法详解
2018/10/10 Python
学习python分支结构
2019/05/17 Python
Python流程控制 while循环实现解析
2019/09/02 Python
python 怎样将dataframe中的字符串日期转化为日期的方法
2019/09/26 Python
浅谈Python中的字符串
2020/06/10 Python
详解pycharm的python包opencv(cv2)无代码提示问题的解决
2021/01/29 Python
美国最大的船只买卖在线市场:Boat Trader
2018/08/04 全球购物
出国英文推荐信
2014/05/10 职场文书
校园会短篇的广播稿
2014/10/21 职场文书
地方课程教学计划
2015/01/19 职场文书
2016年小学植树节活动总结
2016/03/16 职场文书
Mysql数据库表中为什么有索引却没有提高查询速度
2022/02/24 MySQL
MySQL的意向共享锁、意向排它锁和死锁
2022/07/15 MySQL