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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:11:10+00:00 2026-05-22T18:11:10+00:00

How do I manually adjust/set the height of the button-pane in the jQuery dialog

  • 0

How do I manually adjust/set the height of the button-pane in the jQuery dialog without changing the CSS file? I want to adjust the height of the DIV that contains the message and the DIV that contains the button(marked in green lines) from Javascript.

jQuery Dialog

function showMessageDialog(title, message, width){
     // create div if it doesn't exist already
     if(!$("#msgDialogDiv").length) {
         $("<DIV></DIV>").appendTo("body").attr("id","msgDialogDiv");
     }
     // set the message
     $("#msgDialogDiv").html(message).css("color","red");

     // show the dialog
     $("#msgDialogDiv").dialog({
        modal: true, resizable: false, draggable: false, title: title, width: width,
        buttons: {OK: function(){$(this).dialog("close");}}
      });

      // This changes the height as I want.
      // $("#msgDialogDiv").css({"overflow":"hidden","height":"10px"});
      // this changes the font on button
      //$("#msgDialogDiv").dialog("widget").find(".ui-button-text").css("font-size", "11px");
      return;
}

showMessageDialog("Hello Stackoverflow!", "This is my first question on stackoverflow",400);

While posting this question I tried to adjust the DIV height and it worked. I also tried changing the font-size of the button, but that just changes the size of the button. I want to control the size of that entire DIV. Is it due to the padding around the button?

  • 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-22T18:11:11+00:00Added an answer on May 22, 2026 at 6:11 pm

    Found it myself. This is what I was looking for.

    // set the size of the button
    $("#msgDialogDiv").dialog("widget")
                      .find(".ui-button-text").css("font-size", "10px")
    
    // this is not required. but doesn't hurt. To hardcode the height, 
    // just change to height instead of minHeight
    //$("#msgDialogDiv").css({"minHeight":"10px"})
    
    // button pane style
    $("#msgDialogDiv").dialog("widget").find(".ui-dialog-buttonpane")
                      .css({"padding":".1em .1em .1em 0","margin":"0 0 0 0"} )
    
    // button style
    $("#msgDialogDiv").dialog("widget").find("button")
                      .css({"padding":"0 .2em 0 .2em","margin":"0 .5em 0 0"} )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script in place that adjusts the height of a div whenever
Im trying to get a div to auto adjust to the height of the
How can I handle manually the 404 error in C#? I want to check
I want to manually create a ID field where I do MAX + 1,
How do I manually touch a UIView means programattically. I want to touch a
I have an OpenGL view that I would like to manually modify and redraw
I'm working with symfony2, I have a table and I want to manually assign
So basically, I need to manually adjust an inheritance hierarchy. I'd like for the
I've set some default styles for basic elements in WPF that act as default
I have an attributed string that I want to draw bottom-aligned into a rectangular

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.