Looking for a solution to hide the header and navbar upon page load in an iframe
This is the code snippet I have 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've tried various javascript solutions found online, but none seem to be working
When inspecting in Google, adding 'display: none;' to the css class: navbar-inverse hides everything. However, implementing this through javascript doesn't work as expected:
<script type="text/javascript"> var isInIFrame = (window.location != window.parent.location);if(isInIFrame==true)document.getElementsByClassName("navbar-inverse")[0].style.display = "none";}</script>
I've also experimented with different methods from forums and other resources
The page where it's being loaded can be found at this link
Is the issue related to cross-scripting due to the difference in urls between the iframe source and the site itself?
I'm not well-versed in javascript, so any assistance would be highly valued!