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.

Link to comment
Share on other sites

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>

 

Link to comment
Share on other sites

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>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.