开发者

how to add custom theme to jQueryUI themeswitcher?

开发者 https://www.devze.com 2023-01-16 05:36 出处:网络
Here: http://jqueryui.com/docs/Theming开发者_如何学运维/ThemeSwitcher I found nice widget to switch on the fly jQueryUI themes on my page.

Here: http://jqueryui.com/docs/Theming开发者_如何学运维/ThemeSwitcher I found nice widget to switch on the fly jQueryUI themes on my page. And also I've created my own custom theme. How to add it in list of themes?


I used the same solution as you...downloaded the js from http://jqueryui.com/themeroller/themeswitchertool/, saved it as jquery.themeswitcher.js and replaced all http jquery-ui urls with google apis https urls.

The only changes were in the var switcherpane where each link looks like:

<li><a href=
"http://jqueryui.com/themeroller/css/parseTheme.css.php?....">
<img src=
"http://jqueryui.com/themeroller/images/themeGallery/theme_90_ui_dark.png" alt=
"UI Darkness" title="UI Darkness" /> <span class="themeName">UI
darkness</span></a></li>

Which I replaced with:

<li><a href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/themes/ui-lightness/jquery-ui.css">
<img src="content/images/theme_90_ui_light.png" alt="UI Lightness" title=
"UI Lightness" /><span class="themeName">UI lightness</span></a></li>

You can add your custom images as a <li> in the var switcherpane.

If you search through the file there are a few other html images that are referenced further down.

As far as legality goes, I'm not too sure but I can't see why you would't be able to as jQuery UI is free and open source.

0

精彩评论

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