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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:15:07+00:00 2026-05-15T19:15:07+00:00

The file I’m loading into the modal dialog can vary in height. When the

  • 0

The file I’m loading into the modal dialog can vary in height. When the first link is opened, the top of the dialog is centered horizontally (meaning the dialog is positioned too low). After I close this and reopen again, with either the same edit button or a different one, the positioning is better.

It seems like it’s always one step behind: the first load it can’t tell what the width/height is of the file being loaded, then on a subsequent load of the same file, it’s positioned perfectly.

I’m using the following code as a modal edit for a data table:

$(".editMe").button({
    icons: {
        primary: 'ui-icon-document'
    },
    text: false
}).click(function () {
    var eventLink = $(this).attr("name");
    var dialogOpts = {
        title: "Make Modifications or Delete This Event",
        modal: true,
        autoOpen: false,
        height: "auto",
        width: "auto",
        open: function () {
            //The height of the file below can vary, and in the
            //JS Bin environment the dialog loads just fine blank
            $("#modify").load("themes_edit.asp?id=" + eventLink);
        },
        close: function () {
            oTable.fnDraw();
        }
    };
    $("#modify").dialog(dialogOpts).dialog("open");
    return false;
});

And here’s some sample HTML (though the file loaded into #modify isn’t live). I’ve also set this up at JS Bin.

<html>
  <head>
<link class="jsbin" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js"></script>
<link class="jsbin" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
  </head>
    <body>
      <button class="editMe" name="2810">edit</button>
      <button class="editMe" name="2811">edit</button>
      <button class="editMe" name="2812">edit</button>
      <button class="editMe" name="2813">edit</button>
      <div id="modify"></div>
  </body>
</html>
​

​

  • 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-15T19:15:07+00:00Added an answer on May 15, 2026 at 7:15 pm

    The ‘one step behind’ will be because in your dialog open event you try to load the data. So when the dialog shows it will show the old content and then suddenly the new content will appear.

    One way to approach this is to open the dialog but first clear the existing content and show a loading gif whilst you wait for the ajax call to respond with the data, which you then load into the dialog.

    N.B If you are worried about the screen jerk when the dialog resizes then you could put the ajax response into a div that is positioned off screen then get the dimensions, then nicely animate the resize of the dialog whilst fading in the new content.

    var dialogOpts = {
            title: "Make Modifications or Delete This Event",
            modal: true,
            autoOpen: false,
            height: "auto",
            width: "auto",
            close: function () {
                oTable.fnDraw();
            }
    };
    
    var $editDialog = $('#modify').dialog(dialogOpts);
    
    $(".editMe").button({
        icons: {
            primary: 'ui-icon-document'
        },
        text: false
    }).click(function () {
    
        var eventLink = $(this).attr("name");
    
        //clear existing dialog content and show an ajax loader
        $editDialog.html('<div class="loading" />');
    
        //show the dialog
        $editDialog.dialog("open");
    
        //get dynamic content and load it into the dialog and resize
        $.get("themes_edit.asp?id=" + eventLink, function(response){
    
            //fade out ajax loader
            $editDialog.find('div.loading').fadeOut(500, function(){
    
                  $editDialog.html( response )
                             .dialog('option', 'position', 'center');
    
            });
    
        });
    
        return false;
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

File: /home/USER/DIR/a http://www.here.is.a.hyper.link.net/ /home/USER/DIR/b http://www.here.is.another.hyper.link.net/ Need to remove all the odd lines in this
file.each_line do |line| #skip the first one/not a user 3.times { next } if
File.Exists and FileInfo.Exists can't be used in this case, as they check if the
file format change : top to bottom <> left to right input file format:
File systems are volatile. This means that you can't trust the result of one
File formats I would like to play include .wav, .mp3, .midi. I have tried
File is sent to the client using Response.writefile and content diposition as inline. When
FILE *out=fopen64(text.txt,w+); unsigned int write; char *outbuf=new char[write]; //fill outbuf printf(%i\n,ftello64(out)); fwrite(outbuf,sizeof(char),write,out); printf(%i\n,write); printf(%i\n,ftello64(out));
FILE #1 (foo.h): #ifndef FOO_H_ #define FOO_H_ #include baseclass.h #include bar.h class Bar; class
File 1: asdffdsa File 2: asdfjklfdsaHGUik How do I read these binary files with

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.