BVSelect.js是一款纯JavaScript组件,自定义的select下拉选择框。可以带搜索、图表等效果。基本调用方式var mySelect = new BVSelect({ selector: "#selectbox" });带搜索框var mySelect = new BVSelect({ selector: "#selectbox", searchbox: true });自定义搜索文字var mySelect = new BVSelect({ selector: "#selectbox", placeholder: "Select Option", search_placeholder: "Search..." });改变下拉框的选项mySelect.Change({ placeholder: "New Placeholder", search_placeholder: "New Searchbox's Placeholder", options : { 0: { inner_text: 'Option 1', value: "1", disabled: false, separator: false, img: "1.png", icon: "fa fa-home" }, 1: { inner_text: 'Option 2', value: "2", disabled: false, separator: false, img: "2.png", icon: "fa fa-home" }, // ... } }); // apply the change to the dropdown mySelect.Update();更多API方法// 销毁 mySelect.Destroy(); // 获取ID mySelect.GetID(); // 改变设置 mySelect.Change({ placeholder: '', search_placeholder: '', options: {} }); // 添加选项 mySelect.AppendOption({ position: '', options: {} });
未经允许不得转载: ICode联盟 » 插件特效 » 自定义下拉选择框插件BVSelect.js