John6854654654 Posted December 28, 2010 Share Posted December 28, 2010 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 More sharing options...
dragon_sa Posted December 28, 2010 Share Posted December 28, 2010 you could place a <div> tag over the iframe with a full size spacer image and the href set to the website Link to comment https://forums.phpfreaks.com/topic/222801-bar-on-top-of-iframe/#findComment-1152060 Share on other sites More sharing options...
mattyvx Posted January 3, 2011 Share Posted January 3, 2011 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 https://forums.phpfreaks.com/topic/222801-bar-on-top-of-iframe/#findComment-1154225 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.