开发者

Open Web page in modal box?

Is this possible? not just html but also a different style开发者_开发技巧sheet etc while blacking out the rest of the screen?

Thanks for any help.

Ann


Check out Colorbox (Demo). It is a very well put together plugin for jQuery.

Using iFrames you are able to load pretty much anything into this modal plugin. Here is the example code for the demo w/ the iFrame.

markup

<a class='example7' href="http://google.com">Outside Webpage (Iframe)</a>

JavaScript

$(".example7").colorbox({iframe:true, innerWidth:425, innerHeight:344});

So, you could just change http://google.com to ./your-iFrame.html or whatever and it would load and render that entire page!


You can either use window.showModalDialog(although this may be implemented as a new window) or implement a modal dialog yourself by loading the page in an <iframe> and adding a semi-transparent element whose z-index makes it cover the whole document.


Yes, load the data into an iframe. Most modal scripts such as simple modal have this integrated very nicely and only a few options need to be adjusted to make use of it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜