Bootstrap Multiselect
Getting Started
Link the Required Files
First, the jQuery library needs to be included. Then Twitter Bootstrap - both the Javascript library and the CSS stylesheet - needs to be included.
- <!-- Include Twitter Bootstrap and jQuery: -->
- <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css"/>
- <script type="text/javascript" src="js/jquery.min.js"></script>
- <script type="text/javascript" src="js/bootstrap.min.js"></script>
- <!-- Include the plugin's CSS and JS: -->
- <script type="text/javascript" src="js/bootstrap-multiselect.js"></script>
- <link rel="stylesheet" href="css/bootstrap-multiselect.css" type="text/css"/>
The jQuery library can also be included using a CDN, for example the Google CDN:
- <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
Note that the plugin will work both with version 2.x of the jQuery library as well as with version 1.10.x of the jQuery library. So for using the Google CDN you may have to adjust the version.
Create a Select
Now simply use HTML to create your
selectinput which you want to turn into a multiselect. Remember to set themultipleattribute as to get a real multiselect - but do not worry, the plugin can also be used as usual select without themultipleattribute being present.- <!-- Build your select: -->
- <select id="example-getting-started" multiple="multiple">
- <option value="cheese">Cheese</option>
- <option value="tomatoes">Tomatoes</option>
- <option value="mozarella">Mozzarella</option>
- <option value="mushrooms">Mushrooms</option>
- <option value="pepperoni">Pepperoni</option>
- <option value="onions">Onions</option>
- </select>
Call the Plugin
In the end, simply call the plugin on your
select. You may also specify further options, see the Options tab for further information.
Cheese
Tomatoes
Mozzarella
Mushrooms
Pepperoni
OnionsNone selected- <!-- Initialize the plugin: -->
- <script type="text/javascript">
- $(document).ready(function() {
- $('#example-getting-started').multiselect();
- });
- </script>
Bootstrap Multiselect的更多相关文章
- web 前端常用组件【03】Bootstrap Multiselect
实际的项目网站中或多或少的或用到多选框,我选用的一款是 Bootstrap Multiselect. 官方文档:http://www.kuitao8.com/demo/20140224/1/boots ...
- JS组件系列——两种bootstrap multiselect组件大比拼
前言:今天继续来看看bootstrap的另一个组件:multiselect.记得在项目开始之前,博主项目组几个同事就使用哪些js组件展开过讨论,其中就说到了select组件,由于项目的整体风格使用的b ...
- bootstrap multiselect两大组件
组件说明以及API 1.第一个组件——multiple-select.这个组件风格简单.文档全.功能强大.但是觉得它选中的效果不太好.关于它的效果展示,我们放在后面. 2.第二个组件——bootstr ...
- Bootstrap Multiselect插件使用步骤以及常见参数配置介绍
Multiselect是基于jQuery插件的,它可以以下拉列表的形式为用户提供选择内容,能进行单选或者多选.它应用的主要步骤如下: 一,引入需要的相关js和css文件 既然是Bootstrap插件, ...
- Bootstrap Multiselect 设置 option
$.ajax({ type: 'post', url: "helper/ajax_search.php", data: {models: decodeURIComponent(br ...
- bootstrap--- 两种bootstrap multiselect组件大比拼
http://www.cnblogs.com/landeanfen/p/5013452.html 1.第一种可以兼容IE,第二种不能兼容
- bootstrap multiselect的使用 多选下拉菜单
官网网址: http://davidstutz.de/bootstrap-multiselect/
- JS组件系列——Bootstrap Select2组件使用小结
前言:在介绍select组件的时候,博主之前分享过一篇JS组件系列——两种bootstrap multiselect组件大比拼,这两个组件的功能确实很强大,只可惜没有图文结合的效果(也就是将图片放入到 ...
- 黄聪: 50 个 Bootstrap 插件
Bootstrap是快速开发Web应用程序的前端工具包.它是一个CSS和HTML的集合,它使用了最新的浏览器技术,给你的Web开发提供了时尚的版式,表单,buttons,表格,网格系统等等. 本文向你 ...
随机推荐
- tomcat中文请求乱码问题
使用tomcat做服务时,如果发送的url请求中包含中文字符,可能会出现乱码问题:
- jsp servlet基础复习 Part1
jsp和servlet的一些基础知识整理,用于备忘. 一.jsp与servlet的基本关系 1.jsp-->web容器-->servlet-->加载进容器的虚拟机执行-->输出 ...
- JavaScript--3种函数调用的方法
1.函数的简单调用: <script > function fn(p){ alert(p); } </script> <body><script> fn ...
- Heka 最简单例子
技术人员学习都是从简单例子开始的, Heka的应用也是从简单开始的. 需求: 监控一个日志文件的内容, 在标准输出显示出来. 操作步骤: 使用下载好或者编译好的 heka 已经编译好的 rel ...
- untiy3d小工具——修改scene与prefab中的sprite
坑1:因为替换图片要获取所有包含image的组件,开始我使用的是gameobject.getComponents<Image>()和FindObjectsOfType<Image&g ...
- thinkphp引入头文件
<include File="Public:regheader" />
- flex固定底部栏
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- cocos-creator 脚本逻辑-2
1.预制体 1)节点操作 Cc.find(‘node-1’) 获取节点 全局事件 作用于 canvas this.node.destroy() 删除节点(从内存中删除) 添加删除获取节点或组件 let ...
- js和.net后台交互
1.asp.net呼叫js Response.Write("<script language=javascript>"); ...
- MySQL性能优化的20+条经验
1. 为查询缓存优化你的查询 大多数的MySQL服务器都开启了查询缓存.这是提高性最有效的方法之一,而且这是被MySQL的数据库引擎处理的.当有很多相同的查询被执行了多次的时候,这些查询结果会被放到一 ...