子窗口關閉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="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>