子窗口关闭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 href="https://www.jb51.net/skins/default.css" type="text/css" /> <script type="text/javascript" src="https://www.jb51.net/artDialog.js"></script> <script type="text/javascript" src="https://www.jb51.net/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 src="https://www.jb51.net/butterfly.jpg" />' }); //return false; }; function d(){ // art.dialog({title:'dialog内嵌iframe', iframe:'https://www.baidu.com', width:'900', height:'500'}); //已经没有了直接的iframe属性 通过下面的方式内嵌iframe 第二种效果不佳 art.dialog.open("https://www.baidu.com", {width: 320, height: 400}); // art.dialog({title:'dialog内嵌iframe', width:'900px',height:'500px', content:"<iframe src='https://www.baidu.com' width:'100%' height:'100%' />"}); return false; }; function e(){ art.dialog( { title:'动画', fixed:true, content:'<embed src="https://www.jb51.net/article/ddd.rm" type="audio/x-pn-realaudio-plugin" autostart="true"></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 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" value="最简单的对话框"/><br/> <button>基本示例</button><br/> <button>显示图片</button><br/> <button>外部页面</button><br/> <button>视频</button><br/> <button>询问</button><br/> <button>广告</button> <button>关闭</button><br/> <button>弹出菜单</button><br/> </body> </html>
artDialog_v4.1.7点击此处本站下载。
更多关于jQuery相关内容感兴趣的读者可查看本站专题:《jQuery常用插件及用法总结》、《jquery中Ajax用法总结》、《jQuery表格(table)操作技巧汇总》、《jQuery扩展技巧总结》、《jQuery常见经典特效汇总》及《jquery选择器用法总结》