I am attempting to hide the header and navbar when a page is loaded in an iframe
Code I am using on the html page:
<div id="frame2"><iframe width="100%" height="600px" margin-top="-350px" id="frame1" src="http://mls.searchfloridahomelistings.com/i/Neigbs_Bear_Lake_1" frameborder="0" allowfullscreen="allowfullscreen"></iframe></div>
I have tried all of the suggestions I could find using javascript and none are working
When I inspect in google I can add a display: none; to the css class: navbar-inverse and it hides everything but when I try adding the javascript its not working:
<script type="text/javascript"> var isInIFrame = (window.location != window.parent.location);if(isInIFrame==true)document.getElementsByClassName("navbar-inverse")[0].style.display = "none";}</script>
I have also tried several variations from examples given in other posts here and on other forums
The page where it is loading is http://www.searchfloridahomelistings.com/altamonte-springs-homes-for-sale/bear-lake-homes-for-sale/
Is it because the url for the iframe is different from the url for the site - crossscripting?
I am not very familiar with javascript so any help would be greatly appreciated!