function showDiv(Title,w,h,src,dac){ var options = {modal: true,title:Title,closeText:"[x]",width:w,height:h,afterHide:function(){ var div_modal_iframe=document.getElementById("frame"); if(typeof dac != "function"){ alert("parameter dac is not a function!"); } else { dac(div_modal_iframe); } this.unload(); } }; var dialog = new Boxy("<div><iframe id='frame' src='"+src+"' height='"+300+"' width='"+600+"' style='border:0;' /></div>", options); };
注意afterHide事件所调用的函数:
afterHide:function(){ var div_modal_iframe=document.getElementById("frame"); if(typeof dac != "function"){ alert("parameter dac is not a function!"); } else { dac(div_modal_iframe); }
这里function中不能加dac参数,否则会弹出"parameter dac is not a function"