Adding / modifying css on iframe page

just looking for some help on my problem. First of all, I'm a fancy newbie in CSS / code development, so please tell me about me. I was instructed to use this approach on a SharePoint 2013 site. So here it goes ..

Background: . I have a page on a SharePoint 2013 site that has a Content Editor web page that displays a page from one site collection / site collection. I placed the following code (which is not mine) in the content editor, and it displays the entire page.

Problem . My requirement is to “remove globalnav” from the page in the content editor, which I assume uses an iframe. Now I can use the F12 dev tools with IE11 and find the CSS class that is next - ms-dialog #globalNavBox , and set the display to "none" , this is exactly how I want it to look.

The only thing I don’t know how to achieve here is to do it using some kind of code on the page displaying the embedded page.

this is the code that I use in the content editor to display my page that I want to change.   

#mydiv{

width:1280px; height:1000px;
 overflow:hidden;
 ;
}

#myframe{
 ;
 top:-190px;
 left:-100px;
 width:1080px;
 height:1000px;

}
</style>
<div id="mydiv">
<iframe id="myframe" src="/gen/genInduction/Lists...blah scrolling="no"></iframe>&#160;</div>

now I have no idea how to add code (if possible) to remove css.ms-dialog #globalNavBox {display: none;} so that globalnav is deleted when the page is displayed.

, , , , . , , , , , .

.

+4
2

iframe

<script>
document.getElementById("myframe").contentDocument.getElementById("globalNavBox").style.display="none";
</script>
+1

, iframe, , iframe ( , ). JBiserkov , iframe. iframe , . iframes:

Iframes, Onload Document.domain

Iframe

- iframe

var iFrame = document.getElementById('myframe'),

- iframe

- iframed-.

iDoc = iFrame.contentDocument ? iFrame.contentDocument : iFrame.contentWindow.document,

- #globalNavBox

gNav = iDoc.getElementById('globalNavBox');

- iframe , globalNavBox "" "none"

iframe.onload = function () {
        gNav.style.display = 'none';
};
+1

All Articles