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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:00:20+00:00 2026-05-26T10:00:20+00:00

i am working with jquery dialog and my div is show through dialog. my

  • 0

i am working with jquery dialog and my div is show through dialog. my div has a simple css what has background image that should come at center on the div. but when dialog is open then image is showing but at left side not at center. i am not being able to sort this problem. plzz need help. basically i want to show the image at the center on the dialog.

here is my code

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
 <link href="../Styles/ui-lightness/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" />

 <script src="../Scripts/jquery.min.js" type="text/javascript"></script>
 <script src="../Scripts/jquery-ui.min.js" type="text/javascript"></script>
<style type="text/css">
 .BusyStyles
 {
        background-image: url('../images/ajax-loader.gif');
        background-repeat: no-repeat; background-position: center center; 
        height: 150px;
        width: 250px;
 }
 </style>

 <script language="javascript" type="text/javascript">
  $(document).ready(function () {

     var _images = ['../images/ajax-loader.gif'];
     $.each(_images, function (e) {
         $(new Image()).load(function () {
             //alert($(this).attr('src') + 'has loaded!');
         }).attr('src', this);
     });

     $("#dialog").dialog({
         autoOpen: false,
         height: 150,
         width: 250,
         modal: false,
         draggable: false,
         resizable: false,

         show: {
             effect: "fade",
             duration: 2000
         },
         hide: {
             effect: "fade",
             duration: 500
         }

     });

     $("#btnOpen").click(function () {
         $('#dialog').html('<img  src="../images/ajax-loader.gif" border="0" />');
         $("#dialog").dialog("open");
         return false;
     });

     $("#btnClose").click(function () {
         $("#dialog").dialog("close");
         return false;
     });

 }); // doc end
 </script>
</head>
<body>
<form id="form1" runat="server">
<div id="dialog" class="BusyStyles">
</div>
<asp:Button ID="btnOpen" runat="server" Text="Open" />

</form>
</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-26T10:00:21+00:00Added an answer on May 26, 2026 at 10:00 am

    To center horizontally and vertically, in your CSS, add the style

    #dialog {
     text-align:center;
     padding-top: 22px; /* you can use a padding to vertically center*/
    }
    

    Edit :
    Remove the
    $('#dialog').html('<img src="image.GIF" border="0" />');
    because in the BusyStyles Css you already declare a background witch is already center center (and works fine)

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

Sidebar

Related Questions

I've been working on a simple JQuery dialog form that loads in via AJAX.
I am using below code to show jquery dialog, its working perfectly, Sub OpenDialog(ByVal
I'm loading some content into a jquery-ui dialog via .ajax. That's all working fine
I have written a simple jQuery dialog box that will appear in an asp
I have a jQuery dialog which loads an external php page. All is working
Still working through JQuery to get data and repopulate portions of a page. Right
i am working with jquery for animate a div. i want to control speed
I'm working with Jquery in Drupal. I have sets of four blocks that all
some how i manage to have jquery transfer effect working with jquery dialog but
I'm using the jquery ui dialog for a modal popup dialog. It's working great

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.