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 8255061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:24:14+00:00 2026-06-08T01:24:14+00:00

I have run into an issue when getting the jQuery UI dialog to popup

  • 0

I have run into an issue when getting the jQuery UI dialog to popup over a tab view which in turn contains three floated panels (divs). The code goes something like this

<body>
<div id='dialog'>My Dialog</div>
<div id='mytabs'>
<ul><li><a href='#tabA'>Tab A</a></li><li><a href='#tabB'>Tab B</a></li></ul>
<div id='tabA'>
<div id='toolpanel' style='float:left;width:40px'>Content</div>
<div id='proppanel' style='float:left;width:200px'>Content</div>
<div id='datapanel' style='float:left;clear:right;width:100px'>Content</div>
</div>
<div id='tabB'>...</div>
</div>
</body>

Originally, I was expanding the third panel to fill the whole of the available client area. Something along the line of

var wh = $('#tabA').width() - $('#toolpanel').outerWidth() - $('#proppanel').outerWidth();
$('#datapanel').css('width',wh + 'px');
$('#dialog').dialog({modal:true});

However, with this setup I found that the third panel, datapanel floated down below its siblings as soon as I opened the dialog. I have temporarily put in a little hack that is preventing this

$('#datapanel').css('width',wh - 28 + 'px');

Essentially, preventing the datapanel from taking up the full space left over after placing its siblings.

I don’t get it. I thought the jQuery UI dialog does into an absolutely positioned layer with a default zIndex of 1000. If that is the case why should attempting to show it cause my datapanel to float down? And why should that bit of arithmetic, wh – 28, stop that from happening?

I’d much appreciate any help with this one.

  • 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-06-08T01:24:16+00:00Added an answer on June 8, 2026 at 1:24 am

    This happens because of your resizing, not because of jQuery UI, I’ll try to explain exactly why the best I can.

    You have to keep in mind that tabA, as an element without a prescribed width, will, by default, take up 100% of its container (and not the sum of widths of its children, which is what you seem to have assumed), and for this reason your arithmetic when trying to resize datapanel doesn’t work. Actually, if you comment out the dialog invoking line, you’ll see that tabB breaks and falls under the fold because of the resizing.

    You can fix this either by defining a style for tabA’s width or use this piece of code

    var whA = $('#toolpanel').outerWidth(true) + $('#proppanel').outerWidth(true) + $('#datapanel').outerWidth(true);
    
    $('#tabA').css('width',whA + 'px');
    

    You also seem to have neglected the fact that all elements are made of margins+border+padding+content.

    So, when you say

    var wh = $('#tabA').width() - $('#toolpanel').outerWidth() - $('#proppanel').outerWidth();
    

    first of all, by using just outerWidth() instead of outerWidth(true) you are ignoring the margins on the two inner divs.

    Then in:

     $('#datapanel').css('width',wh + 'px');
    

    you are setting the width [which just relates to content] of datapanel to wh, but according to what you have calculated in wh, what you should be setting is the entire width of the div [including the margin, border and padding].

    So, by subtracting

    $('#datapanel').outerWidth(true)-$('#datapanel').width()  //margins+border+padding of datapanel
    

    in wh you get the desired width.

    In conclusion, here’s a code snippet that should work for you:

    var whA = $('#toolpanel').outerWidth(true) + $('#proppanel').outerWidth(true) + $('#datapanel').outerWidth(true);
    
    $('#tabA').css('width',whA + 'px');
    
    var wh = $('#tabA').width() - $('#toolpanel').outerWidth(true) - $('#proppanel').outerWidth(true)-$('#datapanel').outerWidth(true)+$('#datapanel').width();
    
    
    $('#datapanel').css('width',wh + 'px');
    $('#dialog').dialog({modal:true});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have run into an issue where an input field within a form I'm
I am creating a Node.js app on Heroku and have run into an issue.
I am creating my first (!) database, and I have run into an issue
I have run into a small issue in my program. I have a class
I have run into a bit of a design issue with my code. I
Trying to solve an issue for someone else and instead have run into my
I have recently run into a particularly sticky issue regarding committing the result of
I have run into problems getting my local php and rails development environments to
I have run into a slight issue when creating a Wordpress plugin. The plugin
I have run into a bug with firefox and have searched all over and

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.