Home  >  Article  >  Web Front-end  >  Detailed explanation of the use and closing of jQuery plug-in artDialog.js

Detailed explanation of the use and closing of jQuery plug-in artDialog.js

小云云
小云云Original
2017-12-27 09:16:542817browse

This article mainly introduces the use and closing methods of jQuery plug-in artDialog.js, and analyzes the simple use method and related precautions of jQuery pop-up window plug-in artDialog.js based on specific examples. Friends who need it can refer to it. It will help after washing. to everyone.

Close the sub-window artdialog ultimate solution:


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:&#39;hello world!历史&#39;})
    }
 function b(){
  art.dialog(
  {
   content:&#39;欢迎你来到对话框世界!&#39;,
   lock:true,
   style:&#39;succeed noClose&#39;
  },
  function(){
   alert(&#39;你点了确定&#39;); //不管点了确定还是取消默认都会关闭artdialog,除非在这里面返回false
  },
  function(){
   alert(&#39;你点了取消&#39;);
  }
     );
    }
 function c(){
 art.dialog(
 {
 title:&#39;图片查看&#39;,
 fixed:true,
  content:&#39;<img width="817" height="479" src="butterfly.jpg" />&#39;
     });
 //return false;
 };
 function d(){
 // art.dialog({title:&#39;dialog内嵌iframe&#39;, iframe:&#39;http://www.baidu.com&#39;, width:&#39;900&#39;, height:&#39;500&#39;});
 //已经没有了直接的iframe属性 通过下面的方式内嵌iframe 第二种效果不佳
 art.dialog.open("http://www.baidu.com", {width: 320, height: 400});
 // art.dialog({title:&#39;dialog内嵌iframe&#39;, width:&#39;900px&#39;,height:&#39;500px&#39;, content:"<iframe align=&#39;right&#39; src=&#39;http://www.baidu.com&#39; width:&#39;100%&#39; height:&#39;100%&#39; />"});
 return false;
 };
 function e(){
 art.dialog(
 {
 title:&#39;动画&#39;,
 fixed:true,
  content:&#39;<embed src="ddd.rm" type="audio/x-pn-realaudio-plugin" autostart="true" width="420" height="363"></embed>&#39;
     });
 }; //播放avi总是只有声音,没有画面,哎!
function f(){
 art.dialog({content:&#39;你人品稳定么?&#39;, fixed:true, yesText:&#39;我很稳定&#39;, style:&#39;confirm&#39;, id:&#39;bnt4_test&#39;},
 function(){
   art.dialog({id:&#39;bnt4_test&#39;}).content(&#39;你骗人!&#39;);
   return false;//这样对话框才不会关闭
  },
  function(){alert(&#39;你是坏人&#39;);}//按右上角的叉关闭对话框也会执行这个函数
  );
 };
 function g(){
 art.dialog({mouse:true, id:&#39;dg_test34243&#39;, content:&#39;您收到 <strong>2</strong> 条消息&#39;,left:&#39;right&#39;,width:&#39;15em&#39;, top:&#39;bottom&#39;, fixed:true});
 };
 function h(){
 art.dialog({id:&#39;dg_test34243&#39;}).close();
 };
 function i(){
  var _this = document.getElementById(&#39;btn7&#39;);
  if (document.getElementById(&#39;menu_4834783&#39;)) {//如果已经打开了对话框,按这个按钮还能把它关闭
  art.dialog({id:&#39;menu_4834783&#39;}).close();
  _this.innerHTML = &#39;弹出菜单&#39;; //button上显示的内容
  return;
  };
 art.dialog({id:&#39;menu_4834783&#39;, title:&#39;菜单&#39;, content:&#39;请输入:<input style="width:200px;" id="M_dfd" type="text" value="hello world!" />&#39;,
  button:[{name:&#39;确定&#39;,callback:function(){
    var a=document.getElementById(&#39;M_dfd&#39;).value;
    art.dialog({content:a, lock:true, time:1});
    }
  },
  {name:&#39;关闭我&#39;,callback:function(){_this.innerHTML = &#39;弹出菜单&#39;;}}
  ]
  }
  );
 _this.innerHTML = &#39;关闭菜单&#39;;
 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>

Related recommendations:

How to understand the Jquery plug-in

Detailed explanation of how the jquery plug-in tablesorter implements html table usage examples

Introduction and creation of the jquery plug-in datatables attribute Detailed explanation of paging and sorting examples

The above is the detailed content of Detailed explanation of the use and closing of jQuery plug-in artDialog.js. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn