开发者

Applying style to jQueryUI

开发者 https://www.devze.com 2023-02-20 19:11 出处:网络
I have a JQueryUI Autocomplete widget which is working good. Now I am applying this: http://static.jquery.com/ui/css/demo-docs-theme/ui.theme.css

I have a JQueryUI Autocomplete widget which is working good. Now I am applying this:

http://static.jquery.com/ui/css/demo-docs-theme/ui.theme.css

and imported it to the page. How should I access this theme in my jQueryUI? Here is my jQueryUI code:

<script type ="text/javascript">
$(document).ready(function () {
    var availableTags = [
        "ActionScript",
        "AppleScript",
        "Asp",
        "BASIC",
        "C",
        "C++",
        "Clojure",
        "COBOL",
        "ColdFusion",
        "Erlang",
        "Fortran",
        "Groovy",
        "Hask开发者_如何学Pythonell",
        "Java",
        "JavaScript",
        "Lisp",
        "Perl",
        "PHP",
        "Python",
        "Ruby",
        "Scala",
        "Scheme"
    ];
    $('[id$="tbSearch"]').autocomplete({
        source: availableTags

    });
});

Can someone provide me with some guidance? Thank you!


It should just work if you have the theme's css included on your page (and have the correct path to images within the CSS).

Try downloading a custom package from here: http://jqueryui.com/download

You can pick the theme on the right, and it will be packaged with your javascript code and images.

EDIT:

Your HTML should include something like this:

    <link rel="stylesheet" href="styles/ui-lightness/jquery-ui-1.8.7.custom.css" type="text/css" media="screen">
    <link rel="stylesheet" href="styles/myStyles.css" type="text/css" media="screen">
    <script src="scripts/jquery-1.4.4.min.js" type="text/javascript"></script>
    <script src="scripts/jquery-ui-1.8.7.custom.min.js" type="text/javascript"></script>
0

精彩评论

暂无评论...
验证码 换一张
取 消