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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:07:30+00:00 2026-06-13T10:07:30+00:00

Am using Jquery Dialog box in my xhtml page. Since there are 2 Jquery

  • 0

Am using Jquery Dialog box in my xhtml page. Since there are 2 Jquery Dialog box and look & feel of each box was different from the other, I had to use addClass attribute and this has been discussed in this post. Now I have to override many classes like ui-dialog, ui-corner-all, ui-widget-header etc. So, I went on adding the classes using addClass. Code is below,

$('.ui-widget-content').addClass('new-ui-widget-content');
$('.ui-widget').addClass('new-ui-widget');
$('.ui-dialog .ui-dialog-titlebar').addClass('new-ui-dialog new-ui-dialog-titlebar');
$('.ui-widget-header').addClass('new-ui-widget-header');
 $('.ui-helper-clearfix').addClass('new-ui-helper-clearfix');
 ....

$j("#dialog").dialog({
dialogClass: 'new-ui-widget-content',
dialogClass: 'new-ui-widget',
dialogClass: 'new-ui-dialog new-ui-dialog-titlebar',
dialogClass: 'new-ui-widget-header',
dialogClass: 'new-ui-helper-clearfix',
....

But, I noticed that only 1 of the classes is getting overridden. I mean to say, though I have overridden many classes, only new-ui-widget-content is getting overridden(which is placed first).

I also tried in below way. But it gives syntax error.

    $j("#dialog").dialog({
        dialogClass: 'new-ui-widget-content','new-ui-widget',......

Can multiple classes be overridden by addClass?

If so, how it can be done?

  • 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-06-13T10:07:32+00:00Added an answer on June 13, 2026 at 10:07 am

    You really should overwrite unwanted styling from CSS, not by exchanging multiple CSS classes via JavaScript. All you need is some identifier for the second dialog. If #dialog is the first one, I guess the second one is named something along #dialog2.

    Add a second stylesheet file to the HTML page or append to the original jquery-ui-rev.css.
    You additional styles should reflect the slectors in question, but preceded by a #dialog2, which increases the specificity and sets special formattings for any such classes inside a wrapper named #dialog2.

    As I couldn’t find a jquery-ui-rev.css, I’ll give you an example based on the jquery.ui.dialog.css.

    If you want to overwrite some specific property from the selector .ui-dialog, which is in original:

    .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
    

    …you could do so by setting up another selector, while only re-specifying the appropriate properties:

    #dialog2 .ui-dialog {
        width: 500px;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Am using 2 Jquery Dialog box in my xhtml page. There are 2 links
Is there any way to create blocking dialog box using Javascript/JQuery/Ajax ... I have
I'm using the jQuery UI dialog box, in IE & FF on Windows I'm
I'm using jquery dialog box to display Confirm & Cancel button as shown below:
I am using Jquery Dialog box for a cv registration form on my website
I'm using the jquery-ui dialog box . My problem is upon clicking the x
How to prompt browser to display open/save dialog box using jquery?
How do i call a jquery dialog box from a div in a loop?
I am using jquery ui dialog box to display a form.When i click on
I am using Jquery UI Dialog box with FullCalendar plugin. My problem is UI

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.