在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:HemantNegi/jquery.sumoselect开源软件地址:https://github.com/HemantNegi/jquery.sumoselect开源编程语言:JavaScript 77.3%开源软件介绍:jquery.sumoselectjquery.sumoselect.js - A beautiful cross device Single/Multi Select jQuery Select plugin.A jQuery plugin that progressively enhances an HTML Select Box into a Single/Multiple option dropdown list. The dropdown list can be fully customizable using simple css. It can adapt itself according to any device, keeping in mind that the User Experience is not broken. Demo HereView LiveDocumentaion Documentation Here Latest stable : Download from here CDNJS The folks at CDNJS host a copy of the library. The CDN is updated after the release is made public, which means there is a delay between the publishing of a release and its availability on the CDN, so keep that in mind. Just use these links: <!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery.sumoselect/3.1.6/sumoselect.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.sumoselect/3.1.6/jquery.sumoselect.min.js"></script> Notable Features
RequirementsjQuery 1.8.3+ (It is always recommended to use the latest version of jQuery) Desktop Browser SupportIE8+, Firefox 4+, Chrome, Safari 4+, Opera 11+ (Other browsers may work, but I did not test on them) Mobile/Tablet Browser SupportiOs 3+, Android 2.1+ , Windows Mobile (Other browsers may work, but I did not test on them) ForkingIf you find that you need a feature that SumoSelect does not currently support, either let me know via the SumoSelect issue tracker, or fork SumoSelect on Github and easily extend SumoSelect to create your own widget! UsageTo just go with the default options simply do $(document).ready(function () {
$('.selectBox').SumoSelect();
}); To provide optional settings, simply pass a settings object to SumoSelect() $(document).ready(function () {
$('.selectBox').SumoSelect({
placeholder: 'This is a placeholder',
csvDispCount: 3
});
}); You can also use data attributes to set options <select class="selectBox" multiple data-max="2"> If you want an instance to the SumoSelect object to call handler methods const select;
$(document).ready(function () {
select = $('.selectBox').SumoSelect();
}); NOTE: SumoSelect returns an array of select elements if there are more than one in the matching selector. You can also find the instance to the SumoSelect object by directly selecting your select element like $('select.selectBox')[0].sumo. ..... You can perform all the operations on the underlying original select and then reload the UI by $('select.selectBox')[0].sumo.reload(); You can bind your handlers to some sumoselect specific events eg.$('select.selectBox').on('sumo:opened', function(sumo) {
// Do stuff here
console.log("Drop down opened", sumo)
}); Available events
Settings Below are the available settings:
The default settings are : {
placeholder: 'Select Here',
csvDispCount: 3,
captionFormat:'{0} Selected',
captionFormatAllSelected:'{0} all selected!',
floatWidth: 400,
forceCustomRendering: false,
nativeOnDevice: ['Android', 'BlackBerry', 'iPhone', 'iPad', 'iPod', 'Opera Mini', 'IEMobile', 'Silk'],
outputAsCSV: false,
csvSepChar: ',',
okCancelInMulti: false,
isClickAwayOk: false,
triggerChangeCombined: true,
selectAll: false,
search: false,
searchText: 'Search...',
searchFn: function (haystack, needle, el) {
return haystack.toLowerCase().indexOf(needle.toLowerCase()) < 0;
},
noMatch: 'No matches for "{0}"',
prefix: '',
locale: ['OK', 'Cancel', 'Select All'],
up: false,
showTitle: true,
max: null,
renderLi: (li, originalOption) => li,
clearAll: false,
closeAfterClearAll: false
} LicenseCopyright (c) 2016 Hemant Negi Licensed under the MIT license. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论