jQuery – Modal Dialog
Last week I introduced the jQuery Dialog plugin, which allows us to put various dialogs on the screen.
I only gave out the basics of this flexible widget to keep things simple. Today, I want to expand on that a bit by showing off some of the other capabilities.
If you’ve been coding along, pull out the code from last week, because that’s where I’ll be starting from.
One of the things you’ll probably want to do when you create your dialog is to make it modal. The dialog we put up last week still allowed the user to access the controls that were part of the main web page. To prevent that from happening, you can pass a parameter into the .dialog() called “modal.”
Here’s the code you need.
$(function() { $("#dialog").dialog({ modal: true }); });
If you are only working with the newer browsers, this should be all you need. But if you are still fighting with IE6, you’ll also be interested in using the bgiframe parameter
$(function() { $("#dialog").dialog({ modal: true, bgiframe: true }); });
which places an iframe immediately under the dialog so that certain form controls do not bleed through.
Of course, you don’t have to initialize the dialog when the page loads. You could trigger it from a click event of some other control on the page. See the other posts listed below for other jQuery tutorials.
Other post in jQuery
- jQuery - The Man, The Myth, The Legend - October 8th, 2008
- Getting started with jQuery and ASP.NET - October 15th, 2008
- jQuery - Explaining Last Week's Code - October 21st, 2008
- Friday Books - "Learning jQuery" - October 24th, 2008
- jQuery Simple Selectors - October 28th, 2008
- Friday Books - "jQuery in Action" - October 31st, 2008
- jQuery Selectors - Looks just like CSS - November 6th, 2008
- VS2008 SP1 Hotfix to Support "-vsdoc.js" IntelliSense Doc Files - November 11th, 2008
- jQuery Looks like XPath - November 12th, 2008
- jQuery - class manipulation - November 19th, 2008
- jQuery - Events - December 2nd, 2008
- Host jQuery at Google (with Intellisense support) - December 10th, 2008
- jQuery - Calling Your Own Functions - December 16th, 2008
- Friday Books - jQuery Reference Guide - December 19th, 2008
- jQuery - Creating Plug-ins - December 23rd, 2008
- jQuery - Loading Partial Content - December 30th, 2008
- jQuery - Positioning Elements - January 6th, 2009
- AjaxToolKit TabControl Disabled Tab - January 12th, 2009
- jQuery, JSON, and ASP.NET - January 15th, 2009
- Review of the MDC at NYC - January 21st, 2009
- jQuery - Retrieving HTML Fragments - January 22nd, 2009
- jQuery GUI - Drag - February 3rd, 2009
- jQuery - Drop - February 12th, 2009
- jQuery UI - Resizable w/ ASP.NET Themes - February 18th, 2009
- jQuery, bgiframe and IE6 z-order hacks - February 19th, 2009
- jQuery - Sliders (scrollbars to the rest of us) - March 4th, 2009
- jQuery - Using Slider as a Scrollbar - March 12th, 2009
- jQuery - Auto Scrolling the Slider - March 23rd, 2009
- Live Presentation of jQuery - March 23rd, 2009
- Just a Week Away! - April 7th, 2009
- jQuery Tabs - April 9th, 2009
- jQuery Demos From Last Tuesday’s Presentation - April 16th, 2009
- jQuery – Accordion - May 6th, 2009
- CustomValidationControl and jQuery - May 11th, 2009
- Mixing ASP.NET, jQuery and JSON - May 12th, 2009
- jQuery Progressbar - May 20th, 2009
- jQuery – Dialog - June 2nd, 2009
- jQuery – Modal Dialog - June 9th, 2009
- Does jQuery Make Us Lazy? - June 18th, 2009
- jQuery Dialog – With Validation Controls - June 25th, 2009
- jQuery – Date Picker - July 2nd, 2009
- jQuery Splitter - July 21st, 2009
- jQuery Expand/Collapse Using Head Tags - October 15th, 2009
- Do you Need My Help? - November 18th, 2009
- Flash to jQuery - November 30th, 2009
- JQuery, Cufon, and Dynamic Content - December 1st, 2009
- jQuery, Each() and Async Gets - December 2nd, 2009
- jQuery and ASP.NET UpdatePanel - January 6th, 2010
- jQuery 1.4 Released - January 15th, 2010
Other Related Items:
Skechers Women's D'Lites - Myst Light Weight SneakerWomen's Skechers, Athletic
Kenwood KFC-6982IE 6-Inch x 9-Inch 500-Watt Max Power 5-Way Speaker System5-way 6"x9" speakers (pair) * fiber-textured mica-injected polypropylene woofer * 4-ohm impedance * recommended power range: 2-90 watts RMS * frequency response: 28-30,000 Hz * sensitivity: 93 dB *
CR2025 Battery, Package of 5Cross Reference: CR2025, 5003LC, DL2025
If you're new here, you may want to subscribe to the mailing list to get notifications of new post and a virtual tour of past topics. Thanks for visiting!










[...] jQuery – Modal Dialog (Dave M. Bush) [...]