i have few previously built pages that use jquery-ui-dialog and works fine. now my requirement was to make a page with a iframe in it. and this iframe is 开发者_如何学Cused to display those previously created pages. in this case the dialogs from the iframe appears inside the iframe not over the parent document. how can i make the dialogs appear over the parent document containing the iframe with minimum change?
thanks in advance.
If your pages are on the same domain, you could call a function in the parent document from the iframe to display the dialog.
For example...
parent.ShowDialog("Hello World");
With a function in the parent that opens up the UI dialog using the supplied text.
Ugh, iframes always seem to cause problems... best to avoid them completely (I understand if this probably wasn't your choice).
The problem is the browser interprets the i-frame as a separate web page. Not sure, but you could try to define your dialog element (the HTML tags) outside the i-frame and try calling the event from the inside. Something like:
<html>
<div id="callme" style="display:none;">
...
your dialogstuff here
...
</div>
<iframe>
<!-- function that calls the dialog event here -->
</iframe>
</html>
It's worth a shot, I guess.
精彩评论