简体   繁体   中英

jqModal cancel alert box open from Iframe but shows in parent window

I have a web page that has an iFrame. I have full access to both parent window and the iFrame page. In the iFrame, I have a jqModal cancel box that is shown when user input some invalid input. My problem is when the jqModal cancel box is triggered, only content inside of iFrame is tinted, and the message box scrolling position is iFrame's scrolling position.

I am looking for a solution that when jqModal cancel box is triggered, the whole parent window is tinted and the message box's scrolling position is using parent window's scrolling position.

Thank you all.

You must put jqmodal in parent page not in child page(loded in iframe) then you will have to call jqmdal from iframe. For Example, Parent:

<script type="text/javascript">
var myGlobalObject = {};
myGlobalObject.LoadJqModal = function(){
  $("selector").jqModal();      
};
</script>

Iframe:

<script type="text/javascript">
 function LoadJqModal()
 {
   parent.myGlobalObject.LoadJqModal();
 }
</script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM