Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jqueryui dialog to gray out screen

I'm using the jQueryUI (extension?) and have a simple overlay on a page. Here's what I have so far

Anyway is there any built in way to grey out the screen when the dialog is open? I know you can do this by appending another div to the page, I want to know if jQueryUI has something like this built in.

I couldn't find anything like this on the API, maybe I missed something.

like image 929
qwertymk Avatar asked Apr 05 '12 16:04

qwertymk


2 Answers

You can specify options for the dialog using an object literal. One of these options is modal which will place an overlay on the screen behind the dialog. This overlay will prevent the user from clicking behind the dialog.

$('#over').dialog({modal:true});

Example: http://jsfiddle.net/vhA2w/1/

Checkout all of the available options at: http://jqueryui.com/demos/dialog/

like image 78
Kevin Bowersox Avatar answered Oct 25 '22 09:10

Kevin Bowersox


This jsfiddle should work for you

$('#over').dialog({ modal: true });
like image 39
Josh Mein Avatar answered Oct 25 '22 09:10

Josh Mein