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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:32:10+00:00 2026-05-30T20:32:10+00:00

I am using jquery-ui to create a dialog window. the div to be shown

  • 0

I am using jquery-ui to create a dialog window. the div to be shown on the dialog has the class ‘dialog’.

Let us look at the html first :

<div class="click_me">
Click Me
</div><!-- end of class click_me-->


<div class="dialog">

this is my dialog

</div>

css and javascript follow:

<style type="text/css">

.click_me{
    width:120px;
    border:1px solid red;
    text-align:center;

    }


.dialog{

    width:230px;
    border:1px solid green;
    text-align:center;


    }   

</style>

<script type="text/javascript" src="js/jquery-1.7.1.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.16.custom.min.js"></script>


<script type="text/javascript">

$(document).ready(function(){

$(".click_me").click(function(){

    dialog_my=  $(".dialog").clone(false);
    dialog_my.dialog();
    $(".dialog",     dialog_my ).css('width','450px');


    }


);  


    });


</script>

But the line $(".dialog", dialog_my ).css('width','450px'); has no effect. If I omit the context and write the code as $(".dialog" ).css('width','450px'); , then the css is applied both on the flat webpage and on the modal window.

How can I apply the css only on the modal window?

  • 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-30T20:32:12+00:00Added an answer on May 30, 2026 at 8:32 pm

    You are trying to find a div with class dialog in dialog_my which is your div. Just put :

    dialog_my.css('width','450px');

    Or even better, with chaining methods:

    dialog_my = $(".dialog").clone(false).dialog().css('width','450px');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a generic javascript dialog-class based on JQuery to create div-popups
How do I create an edit dialog box using jquery? Let say I have
I'm trying to create a dialog window using JQuery. I'm making progress so far,
I created a page that has a JQuery based dialog using the standard JQuery
I am using jQuery to create a dialog that should show up in the
I'm using jQuery to create a dialog that should pop up on top of
i'm trying to show a modal window (using jquery ui dialog) to the user
I am using JQuery and Jquery UI to create a dialog box which contains
I'm using the following code to create a Dialog box using JQUERY/UI: var $dialog2
I'm unable to correctly create DOM elements using jQuery (1.3.2): var ev_t; $(#add-event).click(function() {

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.