Ricky Mason
Ricky Mason

Reputation: 1828

use browser default scrollbar on jquery ui modal dialog

Is it possible to use jquery ui's dialog, and span it across the full browser height?

Then, if there is extra page, use the browser default scrollbar to go up and down, freezing the rest of the page behind the overlay?

$(function()
  {
    $('#category_modal').dialog({
        autoOpen: false,
        title: 'hello',
        modal: true,
        height: auto,
        width: 500,
        resizable: false
    });
});

Upvotes: 0

Views: 190

Answers (1)

Jack
Jack

Reputation: 1376

Not using the default dialog. You can make the dialog 100% height/width and "overflow" text scrollable using CSS. Your dialog would look something like this in CSS:

#dialog_box {
    width: 100%;
    height: 100%;
    overflow-y: scroll;
}

You could also put an iFrame within the dialog if you wanted. However, this is no way to completely "Freeze" what is in the background. The user can always select the background and use the mouse-wheel or simply use the browser's scroll bar. Using overflow-y will create a 2nd scroll bar on the edge of the dialog that will scroll the content within (should you need to).

Upvotes: 1

Related Questions