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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:34:46+00:00 2026-05-17T19:34:46+00:00

I am using jQuery UI to provide a modal window when a page loads.

  • 0

I am using jQuery UI to provide a modal window when a page loads. This works fine, however, the background layout is messed up compared to the way it should be.

Here is the dialog code:

<div id="dialog" title="Dialog Title">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>

Here is the jQuery:

$(function(){
                // Dialog           
                $('#dialog').dialog({
                    autoOpen: true,
                    width: 300,
                    buttons: {
                        "Ok": function() { 
                            $(this).dialog("close"); 
                        }, 
                        "Cancel": function() { 
                            $(this).dialog("close"); 
                        } 
                    }
                });

                // Dialog Link
                $('#dialog_link').click(function(){
                    $('#dialog').dialog('open');
                    return false;
                });

                //hover states on the static widgets
                $('#dialog_link, ul#icons li').hover(
                    function() { $(this).addClass('ui-state-hover'); }, 
                    function() { $(this).removeClass('ui-state-hover'); }
                );

            });

Here is what the page should look like: http://www.rutlandinc.com/

This is how it looks with jquery dialog in place: http://www.rutlandinc.com/index2.html

Is it possible to have the cake and eat it too?

Thanks.

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

    probably need to use the ready function. You need to load that when the document is ready.

    $(document).ready(function () {

    http://api.jquery.com/ready/

    your site is loading very slow for me, so i can’t even look at the source code. But give that a shot.

    Must be something else because this does work

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    
    
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
    
    
    <link type="text/css" href="jquery-ui-1.8.5.custom.css" rel="stylesheet" /> 
    
            <script type="text/javascript">
                $(document).ready(function (){
                    // Dialog           
                    $('#dialog').dialog({
                        autoOpen: true,
                        width: 300,
                        buttons: {
                            "Ok": function() { 
                                $(this).dialog("close"); 
                            }, 
                            "Cancel": function() { 
                                $(this).dialog("close"); 
                            } 
                        }
                    });
    
                    // Dialog Link
                    $('#dialog_link').click(function(){
                        $('#dialog').dialog('open');
                        return false;
                    });
    
                    //hover states on the static widgets
                    $('#dialog_link, ul#icons li').hover(
                        function() { $(this).addClass('ui-state-hover'); }, 
                        function() { $(this).removeClass('ui-state-hover'); }
                    );
    
                });
            </script>
            <style type="text/css">
                /*demo page css*/
                #dialog_link {padding: .4em 1em .4em 20px;text-decoration: none;position: relative;}
                #dialog_link span.ui-icon {margin: 0 5px 0 0;position: absolute;left: .2em;top: 50%;margin-top: -8px;}
                ul#icons {margin: 0; padding: 0;}
                ul#icons li {margin: 2px; position: relative; padding: 4px 0; cursor: pointer; float: left;  list-style: none;}
                ul#icons span.ui-icon {float: left; margin: 0 4px;}
            </style>    
    
    
    <style type="text/css">
    <!--
    .style2 {
        font-size: 12px
    }
    -->
    </style>
    
    
    </head>
    
    <body class="home">
          <div id="dialog" title="Dialog Title">
                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
            </div>
    
    
    </body>
    </html>
    

    Ok so its a CSS issue. jquery ui uses some generic css rules. Like state-hover, widget-ui etc… You have them defined in the jquery css file and the base.css file. You’ll need to take out what you don’t need.

    The jQuery UI Dialog plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain.

    If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.dialog.css stylesheet that can be modified. These classes are highlighed in bold below.
    Sample markup with jQuery UI CSS Framework classes
    <div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable ui-resizable">
       <div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix">
          <span id="ui-dialog-title-dialog" class="ui-dialog-title">Dialog title</span>
          <a class="ui-dialog-titlebar-close ui-corner-all" href="#"><span class="ui-icon ui-icon-closethick">close</span></a>
       </div>
       <div style="height: 200px; min-height: 109px; width: auto;" class="ui-dialog-content ui-widget-content" id="dialog">
          <p>Dialog content goes here.</p>
       </div>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using jQuery qTip to provide tooltips on a set of buttons, but the
I am using the jQuery layout plugin and the jqGrid plugin in one of
This is a Rails 3 project using jQuery 1.4.4. I have an index action
I'm using jquery to provide clickable overlays, I'd like to replace the default Scroll
I am using jquery colorbox to load images/ videos. But I have this vimeo
Im using the JqueryUI modal form and since im new to Jquery I figured
I am using thedersen's Backbone.validation plugin to provide validation. The validation itself works so
I am using ASP.NET MVC 2. I have a modal dialog (done through jquery
I'm using jquery kwicks for a projects and on document ready I provide the
I'm using JQuery JQueryUI's AutoComplete code. It goes to my url i provide (to

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.