1

I am loading MySites in an iFrame within another Site Collection. This works with a PageViewer webpart but I would like to hide the new Suitebar since there is already one on the parent page. Any ideas on how to do this? The following jQuery should work but it can't seem to find the 'suiteBar' child. My guess would be the iFrame isn't loaded when this fires, but I can get that element. It is the child that I'm having shows undefined.

$(document).ready(function() {
 var iframe = document.getElementById("MSOPageViewerWebPart_WebPartWPQ2");
 var sb = $('#MSOPageViewerWebPart_WebPartWPQ2').contents().find('#suiteBar');
});
  • 1
    Have you tried passing in "?IsDlg=1" to the end of your MySite url when loading? – Aveenav May 7 '14 at 22:20
  • that does hide the DeltaSuiteBar, but it also hides profile picture and the left nav, which I would like to remain there. Thanks tho! – Michael Colbs May 7 '14 at 22:27
1

Since you can view MySite using PageViewer web part, I'm assuming it's within same domain.

<script type="text/javascript">
 $(document).ready(function(){
    var mySiteIframe = $("#MSOPageViewerWebPart_WebPartWPQ2");
       mySiteIframe.load(function(){
       window.console && console.log('Loading Iframe');
       mySiteIframe.contents().find("#suiteBar").css("display", "none");
    });
 });
</script>
  • Thanks Aveenav!! Tweaked the last line in your post and that got it done – Michael Colbs May 8 '14 at 1:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.