JasCav
JasCav

Reputation: 34632

Apply jQuery UI CSS Across Entire Site

I was wondering - is it possible to apply the jQuery UI CSS to an entire site without having to apply it individually upon elements?

So, for example, instead of having to do:

<input type="button" value="Submit" class="ui-state-default ui-corner-all" />

to all my buttons, I instead have some sort of class applied at at top-level DIV which will change the entire site whenever it can be (any element that jQuery UI can handle). If it's not possible, it's no big deal, but it would be great if it is.

Upvotes: 1

Views: 507

Answers (2)

Bob
Bob

Reputation: 3084

I suppose you could apply it on the $(document).ready(function(){$("*").addClass("ui-state-default")});

This is not tested, so don't take my word for it.

Upvotes: 0

Brian Campbell
Brian Campbell

Reputation: 332776

Yes. You can just call

$('button').button()

from your script to select all button elements using jQuery and apply the jQuery UI button theming to them. See, for example, the sample code on the jQuery UI button demo.

Upvotes: 1

Related Questions