Jquery UI主题切换器替代品

时间:2011-12-20 00:11:58

标签: jquery-ui themeroller

我想在我的页面上使用Jquery UI Theme Switcher Widget。 问题是Switcher是通过http托管的,我的页面是https页面。 所以我得到安全错误,包括切换器。

有谁知道我是否可以获得切换台的来源,以便我可以在我的网站上托管它? 或者我可以使用任何第三方切换器脚本吗?

谢谢!

5 个答案:

答案 0 :(得分:15)

对于任何降落在这里的人。这是我发现的。

其中10个列表在这里:( 更新链接已经死亡 - 2016年4月) <删除> http://www.net-kit.com/10-practical-jquery-style-switchers/

您可以在本地运行的jquery主题切换器的替换是: https://github.com/harborhoffer/Super-Theme-Switcher

答案 1 :(得分:4)

我不知道任何其他第三方实现,但也很容易做到。只需在link元素上设置id,并在选择框更改时使用jQuery更改src属性。将它抽象成插件也很容易。

答案 2 :(得分:3)

我不想听起来像是在宣传我所做的项目,但是我写了一个jQuery-UI theme switcher based on the themeswitchertool,以便创建一个实际上像宣传的那样工作的项目。默认情况下,我没有链接到所有主题,但允许您添加所需的任何主题。从jQuery-UI站点添加所有主题是微不足道的。

还有Super Theme Switcher,其他人似乎都在使用它,但它并不像我的那样功能丰富,因为它是旧的themeswitchertool的端口。这一个默认链接所有jQuery UI主题。

答案 3 :(得分:2)

我有类似的错误所以我从http://jqueryui.com/themeroller/themeswitchertool/下载了js,将其保存为jquery.themeswitcher.js并用google apis https urls替换了所有http jquery-ui url。

唯一的变化是在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>

如果您搜索该文件,则会有一些其他html图像被进一步引用。

您可以找到所有图片here

答案 4 :(得分:1)

您只需将src链接设置为“https”,它就可以正常工作。

<link rel="stylesheet" href="themes/MyTheme.min.css" />
<link rel="stylesheet" href="themes/jquery.mobile.icons.min.css" />
<link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.1/jquery.mobile.structure-1.4.1.min.css" />    
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>    
<script src="https://code.jquery.com/mobile/1.4.1/jquery.mobile-1.4.1.min.js"></script>