Avatar of YZlat
YZlat
Flag for United States of America asked on

After JQuery UI dialog is closed, the page remains grayed out

I have an JQuery UI dialog on my page and it unwanted scrollbars I want to get rid of. Resizing the dialog did not help and neither did setting maxHeight and maxWidth

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8" />
        <title>Test</title>
        <link href="Content/themes/base/jquery-ui.css" rel="stylesheet" />
        <script src="Scripts/jquery-1.6.4.js"></script>
        <script src="Scripts/jquery-ui-1.11.4.js"></script>
        <script>
            $(document).ready(function () {
                $(".hlk1").click(function () {
                    var linkId = $(this).attr("linkID");
                  
                    // initialize dialog
                    var dlg = $("#dialog").dialog({
                        autoOpen: false,
                        modal: true,
                        draggable: false,
                        resizable: false,
                        position: { my: "center", at: "center", of: window },
                        height: 380,
                        width: 530,
                        maxHeight: 450,
                    maxWidth: 600,
                    open: function(){
                        $('body').css('overflow', 'hidden');
                        $('.ui-widget-overlay').css('width', '100%‌​');
                        $('.ui-widget-overlay').css('height', '100%');
                    },
                    close: function () {
                        $('body').css('overflow', 'auto');
                        window.location.reload();
                    }
                });

                // load content and open dialog
                dlg.load('page2.html?id=' + linkId).dialog('open');
            });
    });
    </script>
    </head>

    <body>
  
    <a href="#" class="hlk1" linkid="305">Click here</a>
    <br/>
    <a href="#" class="hlk1" linkid="890">Click here</a>
    <br/>
    <div id="dialog"></div>
    </body>
    </html>

Open in new window

jQuery

Avatar of undefined
Last Comment
YZlat

8/22/2022 - Mon
Julian Hansen

Here is your code (http://www.marcorpsa.com/ee/t1370.html)

What I am looking for?
YZlat

ASKER
Julian, this is strange, your code does not ass scrollbars but mine does
Julian Hansen

Without seeing the code as a link where we can see what is happening have to go on the premise that the code posted is correct and there is something you have not given us.

Can you give us a link?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
ASKER CERTIFIED SOLUTION
YZlat

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
YZlat

ASKER
resolved it myself