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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:34:24+00:00 2026-06-13T02:34:24+00:00

I am trying to get my first jQuery UI dialog to pop up in

  • 0

I am trying to get my first jQuery UI dialog to pop up in the center of the user’s screen when they click a button. I would like it to look like the one in the example on that link above (in terms of style, not content).

At the top of my page, I have an internal CSS <style> tag defined, which defines the following rule:

#add-btn-dlg-panel {
    display: none;
}

This rule makes sure the dialog is not visible at page load.

Next, I have the <div> tag that defines the UI of the dialog:

<div id="add-btn-dlg-panel" title="Add new attribute value">
    <div id="attrib-type-input">
        <select id="attrib-type-sel"></select>
    </div>

    <div id="attrib-value-input"></div>

    <div id="add-config-dlg-btn-panel">
        <input id="add-config-dlg-ok-btn" type="button" value="OK"/>
        <input id="add-config-dlg-cancel-btn" type="button" value="Cancel"/>
    </div>
</div>

It consists of a <select>, another div that will be populated based on other events (outside the context of this question), and then two buttons, OK and Cancel.

Finally, I have the jQuery that attempts to draw the UI dialog when the user clicks an “Add” button:

$("#add-config-btn").click(function() {
    $("#add-btn-dlg-panel").show();
    $("#add-btn-dlg-panel").dialog('open');
});

As far as I can tell, everything looks good. But when I fire up a browser (FF) and run this, when I click the “Add” button, the UI dialog draws half-way off my screen (not CENTERED), doesn’t have a border, or resemble the UI dialog in the above link in any way, shape or form.

So I ask:

  • How do I center the UI dialog?
  • How do I style UI dialog so that it resembles the one in the link?

Thanks in advance!

  • 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-13T02:34:25+00:00Added an answer on June 13, 2026 at 2:34 am

    Working demo http://jsfiddle.net/rES7j/show/# or http://jsfiddle.net/rES7j

    scripts

      <script type='text/javascript' src='http://code.jquery.com/jquery-1.5.js'></script>
      <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.js"></script>
    
      <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/blitzer/jquery-ui.css">
    

    code

    $(document).ready(function() {
        $('#theLink').click(function(){
                    $( "#add-btn-dlg-panel" ).dialog( "open" );    
        });
    
        $( "#add-btn-dlg-panel" ).dialog({
                modal: true,
                autoOpen: false,
                height: 255,
                width: 300,
                buttons: {
                    "Retrieve": function() {
                        document.forms["forgotform"].submit();
                    },
                    Cancel: function() {
                        $( this ).dialog( "close" );
                    }
                },
        });
    
    
    });
    

    Working image in chrome

    enter image description here
    ​

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

Sidebar

Related Questions

Playing with jquery for the first time, and I'm trying to get a simple
I am trying to get my first button to update a display number in
I am trying to implement a really simple example to get a first look
I'm trying to get a jQuery dialog to close open clicking cancel, and open
I'm trying to create one of those pop-up boxes you'll get the first time
I'm trying to build my first jquery plugin but i get the following error:
I'm having all kinds of grief trying to re-use a jQuery-UI dialog. First time
Trying to get a button working (jQuery UI chrome and jQuery functionality) in a
I'm trying to get the first paragraph height within a div and store it
I am trying to get the first word in the line that matches the

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.