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! May 7 '14 at 22:27

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

<script type="text/javascript">
    var mySiteIframe = $("#MSOPageViewerWebPart_WebPartWPQ2");
       window.console && console.log('Loading Iframe');
       mySiteIframe.contents().find("#suiteBar").css("display", "none");
  • Thanks Aveenav!! Tweaked the last line in your post and that got it done 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.