基于jquery的選擇插件:ui-choose
ui-choose 選擇插件
基于jquery的選擇插件,可用于選項不太多的select、radio、checkbox等,提升用戶體驗!
demo
基于jquery,使用非常方便!
// 將所有.ui-choose實例化
$('.ui-choose').ui_choose();
// uc_01 ul 單選
var uc_01 = $('#uc_01').data('ui-choose'); // 取回已實例化的對象
uc_01.click = function(index, item) {
console.log('click', index, item.text())
}
uc_01.change = function(index, item) {
console.log('change', index, item.text())
}
// uc_02 select 單選
var uc_02 = $('#uc_02').data('ui-choose');
uc_02.click = function(value, item) {
console.log('click', value);
};
uc_02.change = function(value, item) {
console.log('change', value);
};
// uc_03 ul 多選
var uc_03 = $('#uc_03').data('ui-choose');
uc_03.click = function(index, item) {
console.log('click', index);
};
uc_03.change = function(index, item) {
console.log('change', index);
};
// uc_04 select 多選
var uc_04 = $('#uc_04').ui_choose();
uc_04.click = function(value, item) {
console.log('click', value);
};
uc_04.change = function(value, item) {
console.log('change', value);
};
兼容性
IE8+, Chrome, Firefox, Edge, 360, Sougou 等主流瀏覽器;
項目地址: https://github.com/wangxing218/ui-choose
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!