首页
博客
WEB插件
Chosen下拉框扩展和美化Jquery插件
转载
界面/UI
2019-01-29 17:58:55
浏览:2429
下载:1068
点赞:
191
Chrome
Firefox
Safari
Opera
IE
11
10
9
8
7
6
查看演示
立即下载
赞一个
### 样例 ##### css ```css .lqs-cus-select .chosen-single{ height: 32px; line-height: 31px; border-radius:3px; border-color: #dcdcdc; background: none; background-color: #fff; -webkit-box-shadow: none; box-shadow: none; } .lqs-cus-select .chosen-single div b{ background-position: 0 6px; } .lqs-cus-select.chosen-container-active.chosen-with-drop .chosen-single div b{ background-position: -18px 6px; } .lqs-cus-select .chosen-single abbr{ top:9px; } ``` ##### javascript ```javascript $("#jq-lqs-cus").chosen({ no_results_text: '请选择', width: '240px', allow_single_deselect: true, //出现删除 disable_search: true, search_contains: true, //关闭搜索 inherit_select_classes: true //获取class }); $("#jq-lqs-cus-btn").on('click', function () { alert($("#jq-lqs-cus").val()); }); ``` ##### html ```html
全职
兼职
临时
Giant Panda
Sloth Bear
Sun Bear
Paddington Bear
Polar Bear
Spectacled Bear
American Black Bear
Asiatic Black Bear
Brown Bear
Giant Panda
``` ### 参数说明 |Option|Default|Description| | ------------ | ------------ | | allow_single_deselect | false | When set to true on a single select, Chosen adds a UI element which selects the first element (if it is blank). | | disable_search | false | When set to true, Chosen will not display the search field (single selects only). | | disable_search_threshold | 0 | Hide the search input on single selects if there are n or fewer options. | | enable_split_word_search | true | By default, searching will match on any word within an option tag. Set this option to false if you want to only match on the entire text of an option tag. | | inherit_select_classes | false | When set to true, Chosen will grab any classes on the original select field and add them to Chosen’s container div. | | max_selected_options | Infinity | Limits how many options the user can select. When the limit is reached, the chosen:maxselected event is triggered. | | no_results_text | "No results match" | The text to be displayed when no matching results are found. The current search is shown at the end of the text (e.g., No results match "Bad Search"). | | placeholder_text_multiple | "Select Some Options" | The text to be displayed as a placeholder when no options are selected for a multiple select. | | placeholder_text_single | "Select an Option" | The text to be displayed as a placeholder when no options are selected for a single select. | | search_contains | false | By default, Chosen’s search matches starting at the beginning of a word. Setting this option to true allows matches starting from anywhere within a word. This is especially useful for options that include a lot of special characters or phrases in ()s and []s. | | single_backstroke_delete | true | By default, pressing delete/backspace on multiple selects will remove a selected choice. When false, pressing delete/backspace will highlight the last choice, and a second press deselects it. | | width | Original select width. | The width of the Chosen select box. By default, Chosen attempts to match the width of the select box you are replacing. If your select is hidden when Chosen is instantiated, you must specify a width or the select will show up with a width of 0. | | display_disabled_options | true | By default, Chosen includes disabled options in search results with a special styling. Setting this option to false will hide disabled results and exclude them from searches. | | display_selected_options | true |By default, Chosen includes selected options in search results with a special styling. Setting this option to false will hide selected results and exclude them from searches.** Note:** this is for multiple selects only. In single selects, the selected result will always be displayed. | | include_group_label_in_selected | false |By default, Chosen only shows the text of a selected option. Setting this option to true will show the text and group (if any) of the selected option. | | max_shown_results | Infinity |Only show the first (n) matching options in the results. This can be used to increase performance for selects with very many options. | | case_sensitive_search | false |By default Chosen's search is case-insensitive. Setting this option to true makes the search case-sensitive. | | hide_results_on_select | true |By default Chosen's results are hidden after a option is selected. Setting this option to false will keep the results open after selection. This only applies to multiple selects. | | rtl | false |Chosen supports right-to-left text in select boxes. Set this option to true to support right-to-left text options. **Note:** the chosen-rtl class on the select has precedence over this option. However, the classname approach is deprecated and will be removed in future versions of Chosen. |
上一篇:
没有了
下一篇:
没有了
推荐WEB插件