Nicros
Nicros

Reputation: 5193

jQuery theme for existing html?

I have some existing html- very simple stuff. I would like to theme my site with the jQuery from CDN. I have this in the head of my page:

    <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/ui-darkness/jquery-ui.css" type="text/css">
    <script type="text/javascript" src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script>
    <script type="text/javascript" src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js'></script>

But it doesn't seem to have any effect on my ui. Is there a way to have this magically apply to every element in my page? Or do I need to manually add a class or id to each element? Or initialize things somehow? I was able to get a theme applied to a button, but only by setting class="ui-button" explicitly on the button.

Cheers

Upvotes: 0

Views: 189

Answers (1)

the_marcelo_r
the_marcelo_r

Reputation: 1856

If you check the .css file that you declared you will see all the specific ids/classes that are associated to the style code: http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/ui-darkness/jquery-ui.css

It's just like you mentioned, it contain lots of identifiers like "ui-widget-header" or "ui-state-active", looks like you will have to assign these ids to your markup. The real purpose of this theme configuration is to set styles for JQuery UI components, it is not designed to intrusively affect the look and feel of an existing page.

Upvotes: 1

Related Questions