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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:49:27+00:00 2026-06-09T21:49:27+00:00

Ok so here is what I want to achieve and the problem I am

  • 0

Ok so here is what I want to achieve and the problem I am facing. Steps to follow are:

  1. Open a dialog
  2. drag it around and/or re-size the dialog
  3. Close the dialog
  4. Open the dialog again.

The dialog opens from the position where it was last closed from and the size is what it was last re-sized to. I do not want the dialog to behave this way. I want it to be positioned from the center with auto width every time it is opened. I have provided position: ‘center’ and width: ‘auto’ in the init of the dialog but it does not seem to help.

jQuery Version: 1.7.1
jQuery UI Version: 1.8.17
Browser: IE9/IE8

Below is the HTML:

<div class='mydialog'></div>
<a href='#' id='one'>test1</a>

And here is the code for the dialog itself:

$(function(){
   var theDialog = $(".mydialog").dialog({
        autoOpen: false,            
        modal: true,
        width: 'auto',
        position: 'center',            
    });

    $('#one').click(function(){
        theDialog.html('some random text').dialog( "option", "title", "Dynamic Title").dialog('open');
    }); 
});

I tried searching for a solution but I could not find any. I understand this might be counter intuitive, but it is something that is required.

  • 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-09T21:49:29+00:00Added an answer on June 9, 2026 at 9:49 pm

    Have you tried using the close event that is listed in the documentation here:

    http://jqueryui.com/demos/dialog/

    You could do something like:

    $( ".mydialog" ).dialog({
       close: function(event, ui) {
           $(this).dialog( "destroy" );
    
       }
    }); 
    

    According to the documentation destroy removes the dialog functionality completely. This will return the element back to its pre-init state.

    You may need to initialise the dialog on the click event so that it gets reinitialised each time the link is clicked.

    Alternatively, you can just use return false; on the click event to prevent the unwanted behaviour.

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

Sidebar

Related Questions

Here is what I want to achieve: I want to subclass an UIScrollView to
Here is what I want to achieve: I have RadGridView, let's call it gridView,
What I want to achieve here is to shrink all of the Android's OS
I want to achieve hide/show with div's in html but in this way. Here
I want to make a public transportation application for Android. First problem I'm facing
Yii beginner here. I am facing some problem with how to query the database
maybe the question is wrong but here is what i want to achieve maybe
I want to achieve that two points are rotating around each other. I therefore
Here's what we want to achieve. we have a http server running on a
Here is what I want to achieve ^ Here's how it works now: http://jsfiddle.net/yfxPm/1/

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.