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

  • Home
  • SEARCH
  • 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 6822877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:42:57+00:00 2026-05-26T21:42:57+00:00

I am using JQueryUI Dialog and created this function below: <script> $(document).ready(function() { $(‘#dialog’).dialog({

  • 0

I am using JQueryUI Dialog and created this function below:

<script>
    $(document).ready(function() {
        $('#dialog').dialog({
                autoOpen:false,
                width:100,
                height:200,
                position:[2250,50]
           });


        $('.class112').click(function() {
           var msg = $(this).attr('id');
           $('#dialog').load('classSource/' + msg + '.html', function() {
           $('#dialog').dialog('open');
           });
        });
    });
</script>

and HTML code:

<p class="class112" id="class1">click!</p>

<div id="dialog" style="display: none;"></div>

It works fine but it creates dialog after calling ‘open’ function regardless of positioning. Lets say my computer’s screen has x:1280 and y:760 pixels and body width and height are set to 3000px each in CSS file. Whenever ‘open’ function for dialog is fired, it doesn’t get X position from when it was initialized before, remember :

position:[2250,50]

As a result it creates dialog at very right of the window not exactly at where X was declared to be. But Y comes out correctly because 50px is within the range of my screen resolution.

All I want is when I click ‘click!’ paragraph, I want the dialog box to appear in the initialized position and I might be able to see it after horizontal scroll.
What should I do?

  • 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-26T21:42:57+00:00Added an answer on May 26, 2026 at 9:42 pm

    I think the Dialog widget uses the Position utility to position itself. Looking at the documentation, you may be able to use the collision option to control this behavior:

    When the positioned element overflows the window in some direction,
    move it to an alternative position. Similar to my and at, this accepts
    a single value or a pair for horizontal/vertical, eg. “flip”, “fit”,
    “fit flip”, “fit none”.

    http://jqueryui.com/demos/position/#option-collision

    EDIT:

    Yes, looking at the source of 1.8.16 the default option is “fit”:

        position: {
            my: 'center',
            at: 'center',
            collision: 'fit',
            // ensure that the titlebar is never outside the document
            using: function(pos) {
                var topOffset = $(this).css(pos).offset().top;
                if (topOffset < 0) {
                    $(this).css('top', pos.top - topOffset);
                }
            }
        },
    

    You will want to override that to “none” probably.

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

Sidebar

Related Questions

Using jQuery/jQueryUI I want to populate a form using this HTML/JS show below. The
I am tryng to use this: http://jqueryui.com/demos/dialog/#modal-form I have: <script type=text/javascript> $(document).ready(function() { $(#dialog).dialog();
I am using a jQuery dialog with autoOpen set to false. The first time
I am trying to create popup using the jqueryui dialog. I am trying to
To give more information I am using the modular form here: http://jqueryui.com/demos/dialog/#modal-form `b(e.target).zIndex` is
I'm using the jQuery UI dialog with modal=true . In Chrome and Safari, this
I'm using jQueryUI to build some modal boxes. I've created and implemented a default
I want to create a jQuery dialog on-the-fly. I'm using this: var newDiv =
I have a string created using asp.net MVC3 Razor block like this: @{ var
I need to fill a object using jQuery I have a dialog (jQueryUI) that

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.