2010-09-16 86 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是免費且開源的。

相關問題