做一个iframe的弹出框

群里有个人想在微信页面里面加弹出框。作为前端的我,想着不可能这样做。后来一个人说了:

A:如果对方没有防盗链的话,你可以建个页面,内置iframe 到他的页面,然后把url 的参数也传入你的iframe。广告什么的就在你的主页面弹就好了
B:咋实现啊?
A:或者你可以做的酷一点。就是用模拟http 请求预先获取他的页面内容,然后重新排版渲染到你的页面上
B:很多盗版小说网站都是这么干的
 
我于是想到了一个解决方案:
 1 <!DOCTYPE html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <title>Document</title>
 6     <style type="text/css">
 7     *{padding:0px;margin:0px;}
 8     body{position:relative;}
 9     html,body,iframe{height:100%;}
10     .adv{width:300px;height:200px;background-color:pink;position:absolute;bottom:500px;right:0px;}
11     </style>
12 </head>
13 <body>
14     <iframe src="https://www.baidu.com/index.php?tn=monline_3_dg" width="100%" height="100%" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no" allowtransparency="yes"></iframe>
15     <div class="adv">你的窗口!</div>
16 </body>
17 </html>

效果截图:

原来是可以的,又学习了。

posted @ 2016-05-25 14:44  SkyTeam_LBM  阅读(4238)  评论(0编辑  收藏  举报