Jump to content

[SOLVED] opening an iframe in/or for the background of a website.


A2xA

Recommended Posts

yeah actually you can. load the webcode with something like:

 

$capture=preg_replace('/.*<body>(.*)<\/body>.*/i', '$1', trim(file_get_contents ('http://www.whatever.com')));

 

then echo the contents of $capture to a div with a z-index lower than the rest of the site. I would also use an alpha filter/opacity of 50%

 

Good luck, I like to see the end result.

 

you could also use ajax to get the background.

ajax only works if both pages are in the same domain.

 

here a quick and dirty example:

http://resago.com/test.php

 

<html>
<head>
</head>
<body>
<div id="main" style="position: absolute; left: 0px; top: 0px; z-index=0;filter:alpha(Opacity=20)">
<?php  
print preg_replace('/.*<body>(.*)<\/body>.*/', '$1', trim(file_get_contents ('http://www.cnn.com')));
?>
</div>

<div style="position: absolute; left: 0px; top: 0px; width=100%;height=100%; z-index=99;filter:alpha(Opacity=60)">  
<center>
Some stuff.<br>
<h1>HAHA, we are on top of you!</h1>
<br>
blahblahblahblaowivfwiejfoweiuvhosdunvlidsunvldsinuvf<br>
<h1>poop poop poop poop poop<br>
HAHAHAHAHA<br>
LALALALA<br>
okokokok<br>
<h1>poop poop poop poop poop<br>
HAHAHAHAHA<br>
LALALALA<br>
okokokok<br>
</h1>
</center>
<br><BR><BR><BR><BR><BR><BR><BR><br><BR><BR><BR><BR><BR><BR><BR>
<br><BR><BR><BR><BR><BR><BR><BR><br><BR><BR><BR><BR><BR><BR><BR>
<br><BR><BR><BR><BR><BR><BR><BR><br><BR><BR><BR><BR><BR><BR><BR>
</div>
</body>
</html>

 

Here is it using an iframe. I would use this method instead of php.

 

<html>
<head>
</head>
<body>
<div id="background" style="position: absolute; left: 0px; top: 0px; z-index=1;filter:alpha(Opacity=30)">
<iframe src="http:\\www.cnn.com" height="768" width="1024" scrolling=no style="z-index=0"></iframe>
</div>

<div id="foreground" style="position: absolute; left: 0px; top: 0px; width=1024px; height=768px;z-index=99;filter:alpha(Opacity=60)">  
<center>
Some stuff.<br>
<h1>HAHA, we are on top of you!</h1>
<br>
blahblahblahblaowivfwiejfoweiuvhosdunvlidsunvldsinuvf<br>
<h1>
HAHAHAHAHA<br>
LALALALA<br>
okokokok<br>
okokokok<br>
okokokok<br>
okokokok<br>
okokokok<br>
okokokok<br>
okokokok<br>
okokokok<br>
okokokok<br>
okokokok<br>
okokokok<br>
okokokok<br>
okokokok<br>
okokokok<br>
okokokok<br>
okokokok<br>
okokokok<br>
okokokok<br>
okokokok<br>
</h1>
</center>

</div>
</body>
</html>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.