Jump to content

bar on top of iframe


John6854654654

Recommended Posts

I am trying to create a page with two parts: a top bar, and a content area below. The content area is an iframe with someone elses site in it. The top bar is my content. I want my top bar to go away and show only what is within the iframe when a user clicks a button. Essentially a redirect to whatever the current location of the iframe is. It is as if the user right clicked on the iframe and clicked "show only this frame". I can almost do this using javascript, but I have only been able to send the user to the original iframe location, and not the current iframe location. I understand that grabbing the current iframe location and storing it in a variable or something cannot be done, but is there another way to go about this?

 

Thanks in advance!

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/222801-bar-on-top-of-iframe/
Share on other sites

I want my top bar to go away and show only what is within the iframe when a user clicks a button.

Thanks in advance!

 

<a href="#" onclick="document.getElementById('1').style.display='none'">Hide</a>
<a href="#" onclick="document.getElementById('1').style.display=''">Show</a>

<iframe src='http://www.google.com' id='1' name='1' />

 

Adapt the above code, should work fine!

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.