Reputation: 601
I have my own styled form, and I wanna use jQuery UI's .dialog()
in order to display it with an overlay, and as a modal dialog.
Problem is, jQuery enforces its own classes and styles, such as:
ui-dialog ui-widget ui-widget-content
Is there a simple way for me to instruct jQuery not to use its own css ??
Thanks!
Upvotes: 2
Views: 4697
Reputation: 1638
There is an option when initializing .dialog() for dialogClass (http://jqueryui.com/demos/dialog/#option-dialogClass) which allows you to add classes for additional themeing. However, I would not recommend removing the classes jQuery UI adds, realistically if you want the dialog to look differently you should just re-style your jquery.ui.css.
Upvotes: 0
Reputation: 375
However if you really need remove the classes then you can bind another function to the dialog open function that is called after the window opens.
$( ".selector" ).dialog({
open: function(event, ui) { ... }
});
The open is where you should be able to write another function.
Upvotes: 0
Reputation: 375
Those classes are what drive the popup in the first place via the CSS that the JS is bundled with.
JQuery UI uses those classes for the stlying and visibility of the dialog window.
If you want to change the style then it's better update the CSS if that is what your trying to do. Update your own CSS to override the CSS styles if you want to re-use the UI styles elsewhere in your site.
Upvotes: 2