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
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!

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.