1

I have designed my custom master page. Now, that master page also apply in SharePoint modal dialogs.

I want to change certain css for that popup only. Is their any way I can do that? I have triedt o change css on ms-dlgframe load event. But it's not working.

function Hide() {
        $('.ms-dlgFrame').load(function () {
            try {
                $('.s4-pr.s4-ribbonrowhidetitle', frames[0].document).hide();
                $('.s4-pr.s4-ribbonrowhidetitle', frames[1].document).hide();
                $('.wrapper').css("min-width", "0");

            } catch (e) {

            }
        });
    } 
1

To change CSS styling on the modal dialog, you need to use the something like this:

.ms-dialog .wrapper
{
  min-width: 0;
}

Hope that helps.

2

Assuming you are using SharePoint 2010 in some form or other: There is the CSS class s4-notdlg - Assign this class to all master page elements that you do not want to appear in the modal dialogs.

For more information refer to http://blog.drisgill.com/2009/11/sp2010-branding-tip-2-custom-master.html

  • Thanks for replay. I have done similar that. But my problem is that i have to change wrapper class css when it open in model dialog box. How can i change that? For all page wrapper class css is fine but when i open in model popup i have to change css – user1337886 Jun 11 '13 at 12:34
  • I don't think the wrapper class approach is a good idea, and I don't know why you ask me about it. I did not recommend it for the very reasons you are now experiencing. The s4-notdlg is a robust approach. – teylyn Jun 11 '13 at 20:26

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.