大佬教程收集整理的这篇文章主要介绍了asp.net – 移动ModalPopup在IFrame之外 可能?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我尝试使用jQuery将modalpopup从iframe移动到父窗体body元素(或父体内的任何其他元素)。我得到一个无效的参数错误。
如何从iframe中的页面显示一个模式,并且它应该覆盖整个文档,父文档?
更新:
因为很少有用户对实现相同的行为感兴趣。这里是解决方法
我建议的最好的解决方法是在主页面中添加模态文件,然后从iframe中调用它。说这样的东西..
/* function in the main(parent) page */ var _onMymodalPopupHide = null; function pageLoad(){ // would be called by ScriptManager when page loads // add the callBACk that will be called when the modalpopup is closed $find('MymodalPopupBehaviorID').add_hidden(onMymodalPopupHidE); } // will be invoked from the iframe to show the popup function ShowMymodalPopup(callBACk) { _onMymodalPopupHide = callBACk; $find('MymodalPopupBehaviorID').show(); } /* this function would be called when the modal popup is closed */ function onMymodalPopupHide(){ if (typeof(_onMymodalPopupHidE) === "function") { // fire the callBACk function _onMymodalPopupHide.call(this); } } /* functions in the page loaded in the iframe */ function ShowPopup(){ if(typeof(window.parent.ShowMymodalPopup) === "function") { window.parent.ShowMymodalPopup.apply(this,[OnPopupClosed]); } } // will be invoked from the parent page .. after the popup is closed function OnPopupClosed(){ // do something after the modal popup is closed }
希望它有帮助
以上是大佬教程为你收集整理的asp.net – 移动ModalPopup在IFrame之外 可能?全部内容,希望文章能够帮你解决asp.net – 移动ModalPopup在IFrame之外 可能?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。