Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5996429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:06:07+00:00 2026-05-23T00:06:07+00:00

Is there any way to create a modal ‘scope’ for jQuery dialogs? As a

  • 0

Is there any way to create a modal ‘scope’ for jQuery dialogs? As a somewhat contrived example, I’ve got a page:

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Console</title>

        <link href="console.css" rel="stylesheet" type="text/css" />
        <link href="libs/jquery-ui/jquery-ui-1.8.13.custom.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="libs/jquery/jquery-1.6.1.min.js"></script>
        <script type="text/javascript" src="libs/jquery-ui/jquery-ui-1.8.13.custom.min.js"></script>
    </head>

    <body>
        <div id="toolbar"></div>
        <div id="mainContent"></div>
        <div id="footer"></div>
    </body>
</html>

I want to create some modal dialogs for the mainContent area. When the dialog is open, I want to not allow interaction with the mainContent area, but still allow interaction with the toolbar and footer.

Or if a page has multiple mainContent-like divs, each one has there own independent set of modal dialogs that still allow interaction with the other divs.

I know how to create modal dialogs with the jQuery UI library; my question is specifically about applying modality to a section of the page rather than the entire page, either using this library, or in a way that easily complements this library.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:06:07+00:00Added an answer on May 23, 2026 at 12:06 am

    Simple solution would be to have a hidden div that would act as an overlay. It would always have the same dimensions and positioning as your “mainContent” div. Then show that div over the top of your content by using the z-index. Then place your modal on top of the overlay.

    Net effect, everything will be covered in main content area by the overlay but your modal will rest on top of the overlay and thus the user can only interact with it.

    Edits:

    Z-index management: I would just set the overlay z-index to a high base number to avoid conflicts with other z-indices. Then whenever showing the modal, just have jquery selectors that look for shown overlays and increment the modal z-index by one of that number.

    .Overlay
    {
       z-index: 200;
    }
    
    .Modal
    {
      //...
    }
    
    function ShowModal(modalId)
    {  
       var maxZIndex = 200;
       $('.Overlay :visible').each(function()  //find all visible overlays
       {
          var currZIndex = $(this).attr('z-index');
          maxZIndex = currZIndex > maxZIndex ? currZIndex : maxZIndex; //max, min alg.
       }
       $('#' + modalId).attr('z-index', maxZIndex + 1);
       //... do some positioning of modal here
       $('#' + modalId).show();
    }
    

    Positioning: You will need to write javascript to position your overlay over the desired area. I would think using absolute positioning will make this easy. Then obviously you should position the modal div in the center of the overlay div.

    The calculations aren’t really that hard to position something in a centered fashion. Let me know if you want my take on doing that piece.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to achieve the iTunes style modal view controller chain (see
How do I come to know whether a create or any other action has
I'm using the Google Earth Web-plugin API and I've got a 3d model of
The end goal is to create a helper found at the end called show_status(contact,event).
I have been searching for a couple hours for a way to accomplish this
I use DirectX to create a boxmesh,and I want to get the vertices position
I'm writing a Windows CE application in C++ directly applying the WINAPI. In this
With Rails/ActiveRecord 2.3.8 I'd like to do: AnyModel.connection.create_table( 'temp_any_model', temporary: true, id: false, options:
Let's say you have a HTML form: <form> <input name = in1 id=in1 type=text
class Article(models.Model): def user_may_see_full_version(self, user): # do something very sophisticated with the user return

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.