2010-09-16 85 views
1

Here:http://jqueryui.com/docs/Theming/ThemeSwitcher 我发现很好的小部件,可以在我的页面上切换jQueryUI主题。 而且我也创建了我自己的自定义主题。如何将它添加到主题列表中?如何将自定义主题添加到jQueryUI themeswitcher?

+0

我找到了一些解决方法:保存.js文件(来自http://jqueryui.com/themeroller/themeswitchertool/)并编辑它..添加我的主题属性。它显示出来..但我不知道它是否合法?如果我被保存并使用他们的JavaScript文件并从我的主机上加载它,您认为如何? – MechanisM 2010-09-16 16:44:19

+0

我在想同样的事情。主题切换器没有开箱即可,这有点令人讨厌 – boca 2011-07-27 16:25:24

回答

0

我使用了与您相同的解决方案...从http://jqueryui.com/themeroller/themeswitchertool/下载了js,将其保存为jquery.themeswitcher.js,并将所有http jquery-ui网址替换为google apis https网址。

唯一的变化是在var switcherpane其中每个环节的样子:

<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> 

我与替换:

<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> 

您可以在var switcherpane添加自定义图像作为一个<li>

如果您通过文件搜索,还有其他一些html图像被进一步引用。

就合法性而言,我不太确定,但我不明白为什么你不能够像jQuery UI是免费且开源的。

相关问题