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,表格,网格系统等等. 本文向你 ...
随机推荐
- 关于80286——《x86汇编语言:从实模式到保护模式》读书笔记15
一.80286的工作模式 80286首次提出了实模式和保护模式的概念. 实模式:和8086的工作方式相同: 保护模式:提供了存储器管理机制和保护机制,支持多任务. 二.80286的寄存器 (一)通用寄 ...
- VMware workstation 虚拟机安装Windows Server 2008 r2
问题秒速: VMware workstation 虚拟机安装Windows Server 2008 r2,配置好参数后,选择开机,报错,错误如图:
- JavaScript十大古怪之处(出自众妙之门)
1. null是一个对象: alert(typeof null); //objects NULL表示没有值,那么很明显他不能作为任何东西的实例,所以下式应该等于false: alert(null i ...
- 本地如何将svn和git管理的代码做关联
svn和git都是广为流传的代码版本管理工具,实际项目中往往会将两者结合使用,那么如何将本地的一份代码和两者做有机的关联呢! 前提假设:项目已经在开发阶段中,此时变更了svn代码库的地址:或者是组里来 ...
- jsp servlet基础复习 Part2--GET,Post请求
最近进行servlet和jsp方面的梳理复习时,发现以前忽略了一个非常重要的知识点:get和post的请求(如果你觉得两者仅仅是提交数据量的大小以及方式不同就大错特错了)的正真区别,下面进行简答的整理 ...
- SpringCloud实战之初级入门(三)— spring cloud config搭建git配置中心
目录 1.环境介绍 2.配置中心 2.1 创建工程 2.2 修改配置文件 2.3 在github中加入配置文件 2.3 修改启动文件 3. 访问配置中心 1.环境介绍 上一篇文章中,我们介绍了如何利用 ...
- spring_boot启动报错
配置好pom文件后,在controller加注解,如下: 运行后报错!!! 发现配置加的是多此一举,修改为下边的,运行OK
- 基于Node.js的ghost开源博客平台
Ghost 是一套基于Node.js 构建的开源博客平台(Open source blogging platform),具有易用的书写界面和体验. 1.安装node windows 下安装npm:ht ...
- influxdb 端口、数据结构、写数据
InfluxDB 是一个开源,分布式,时间序列,事件,可度量和无外部依赖的数据库. InfluxDB有三大特性: Time Series (时间序列):你可以使用与时间有关的相关函数(如最大,最小,求 ...
- Ascii码 unicode码 utf-8编码 gbk编码的区别
ASCII码: 只包含英文,数字,特殊符号的编码,一个字符用8位(bit)1字节(byte)表示 Unicode码: 又称万国码,包含全世界所有的文字,符号,一个字符用32位(bit)4字节(byte ...