Themeswitcher
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:modified version of jquery-ui themeswitcher widget
This is my own modified version of the jquery-ui themeswitcher widget, which was originally found on the jQuery UI Docs website.
Ever since jquery changed its hotlinking policies, the widget began to break.
So users started downloading it locally.
This gave me the opportunity to look at the code more closely.
Changes I decided to make:

* instead of creating the html markup for the list of jquery-ui themes with a single string, 
  I decided to construct an object that will then be iterated over in order to build the string for the ul list markup. 
  This way it is much easier to add / subtract themes from the list.
* I didn't like the loadTheme option triggering a click on the ul list and subsequently calling the onselect callback. 
  So I made a couple simple modifications to the cookie read / loadTheme option behaviour, 
  eliminating the click trigger and the onselect callback. 
  This way the onselect callback is only triggered when an actual user instantiated selection is made on the widget.

When [js-cookie](https://github.com/js-cookie/js-cookie/blob/latest/src/js.cookie.js "Javascript Cookie") is available the plugin utilizes it to save and load the most recently chosen theme.

Any other ideas for bettering this very useful plugin are welcome!

[See it live here](https://johnrdorazio.github.io/Themeswitcher/ "JohnRDOrazio Themeswitcher")

# Available Options

Options:


NameTypeDefault
loadTheme String Default: null

Load a theme as soon as the switcher loads. String must match the name of a theme in the switcher menu.

jqueryUiVersion String Default: currently loaded jQuery UI version if detected, else '1.12.1'

Choose which version of the jQuery UI CSS stylesheet to use, based on the version of the jQuery UI library you are using. Possible values are: "1.12.1", "1.12.0", "1.11.4", "1.11.3", "1.11.2", "1.11.1", "1.11.0", "1.10.4", "1.10.3", "1.10.2", "1.10.1", "1.10.0", "1.9.2", "1.9.1", "1.9.0", "1.8.24", "1.8.23", "1.8.22", "1.8.21", "1.8.20", "1.8.19", "1.8.18", "1.8.17", "1.8.16", "1.8.15", "1.8.14", "1.8.13", "1.8.12", "1.8.11", "1.8.10", "1.8.9", "1.8.8", "1.8.7", "1.8.6", "1.8.5", "1.8.4", "1.8.2", "1.8.1", "1.8.0", "1.7.3", "1.7.2", "1.7.1", "1.7.0", "1.6.0", "1.5.3", "1.5.2"

initialText String Default: 'Switch Theme'

Sets the initial text in the widget button before a theme has been chosen.

buttonPreText String Default: 'Theme: '

Sets the text in the widget button that precedes the theme name when a theme is chosen.

closeOnSelect Boolean Default: true

Close the switcher menu when a theme is selected.

cookieName String Default: 'jquery-ui-theme'

The name of the cookie that the switcher will set for your domain. Once a theme has been selected, it will be remembered on future loads.

onOpen Function Default: null

Callback function to be executed whenever the switcher menu opens.

onClose Function Default: null

Callback function to be executed whenever the switcher menu closes.

onSelect Function Default: null

Callback function to be executed whenever a theme is selected.


本源码包内暂不包含可直接显示的源代码文件,请下载源码包。