Getting Started

  1. 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.

    1. <!-- Include Twitter Bootstrap and jQuery: -->
    2. <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css"/>
    3. <script type="text/javascript" src="js/jquery.min.js"></script>
    4. <script type="text/javascript" src="js/bootstrap.min.js"></script>
    5. <!-- Include the plugin's CSS and JS: -->
    6. <script type="text/javascript" src="js/bootstrap-multiselect.js"></script>
    7. <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:

    1. <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.

  2. Create a Select

    Now simply use HTML to create your select input which you want to turn into a multiselect. Remember to set the multipleattribute as to get a real multiselect - but do not worry, the plugin can also be used as usual select without the multipleattribute being present.

    1. <!-- Build your select: -->
    2. <select id="example-getting-started" multiple="multiple">
    3. <option value="cheese">Cheese</option>
    4. <option value="tomatoes">Tomatoes</option>
    5. <option value="mozarella">Mozzarella</option>
    6. <option value="mushrooms">Mushrooms</option>
    7. <option value="pepperoni">Pepperoni</option>
    8. <option value="onions">Onions</option>
    9. </select>
  3. 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
                                         
    Onions

    None selected 
    1. <!-- Initialize the plugin: -->
    2. <script type="text/javascript">
    3. $(document).ready(function() {
    4. $('#example-getting-started').multiselect();
    5. });
    6. </script>

Bootstrap Multiselect的更多相关文章

  1. web 前端常用组件【03】Bootstrap Multiselect

    实际的项目网站中或多或少的或用到多选框,我选用的一款是 Bootstrap Multiselect. 官方文档:http://www.kuitao8.com/demo/20140224/1/boots ...

  2. JS组件系列——两种bootstrap multiselect组件大比拼

    前言:今天继续来看看bootstrap的另一个组件:multiselect.记得在项目开始之前,博主项目组几个同事就使用哪些js组件展开过讨论,其中就说到了select组件,由于项目的整体风格使用的b ...

  3. bootstrap multiselect两大组件

    组件说明以及API 1.第一个组件——multiple-select.这个组件风格简单.文档全.功能强大.但是觉得它选中的效果不太好.关于它的效果展示,我们放在后面. 2.第二个组件——bootstr ...

  4. Bootstrap Multiselect插件使用步骤以及常见参数配置介绍

    Multiselect是基于jQuery插件的,它可以以下拉列表的形式为用户提供选择内容,能进行单选或者多选.它应用的主要步骤如下: 一,引入需要的相关js和css文件 既然是Bootstrap插件, ...

  5. Bootstrap Multiselect 设置 option

    $.ajax({ type: 'post', url: "helper/ajax_search.php", data: {models: decodeURIComponent(br ...

  6. bootstrap--- 两种bootstrap multiselect组件大比拼

    http://www.cnblogs.com/landeanfen/p/5013452.html 1.第一种可以兼容IE,第二种不能兼容

  7. bootstrap multiselect的使用 多选下拉菜单

    官网网址: http://davidstutz.de/bootstrap-multiselect/

  8. JS组件系列——Bootstrap Select2组件使用小结

    前言:在介绍select组件的时候,博主之前分享过一篇JS组件系列——两种bootstrap multiselect组件大比拼,这两个组件的功能确实很强大,只可惜没有图文结合的效果(也就是将图片放入到 ...

  9. 黄聪: 50 个 Bootstrap 插件

    Bootstrap是快速开发Web应用程序的前端工具包.它是一个CSS和HTML的集合,它使用了最新的浏览器技术,给你的Web开发提供了时尚的版式,表单,buttons,表格,网格系统等等. 本文向你 ...

随机推荐

  1. Spring Boot学习笔记-配置devtools实现热部署

    写在前面 Spring为开发者提供了一个名为spring-boot-devtools的模块来使Spring Boot应用支持热部署,提高开发者的开发效率,无需手动重启Spring Boot应用. de ...

  2. android添加系统(服务、应用)

    1. 添加系统服务 1.1 添加方式1:(不加入servicemanager统一管理的) 看Android6.0.1 init.rc解析中的第2章和第3章 方式1: 1). 写一个测试脚本test.s ...

  3. ddddddeeeessssssttttrrrrrrooooooyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy

    我遥远的 POI 计划啊 https://loj.ac/problems/search?keyword=POI2011 atcoder 一套 动态 DP SAM 随便看 XSY 的题 UOJ Roun ...

  4. docker创建nginx镜像

    注意:此处不是用的dockerfile创建的镜像,只是用来搞一搞 首先你的系统里面要安装docker,这里就不重复介绍了,可以看之前的文章: 然后再搞一个基础镜像 docker pull regist ...

  5. .NET 中使用阿里云短信的 API 接口

    小弟初来乍到,这也是我的第一篇文章,写的不好的地方还望指正.谢谢各位! 引言 短信服务(Short Message Service)是阿里云为用户提供的一种通信服务的能力,支持快速发送短信验证码.短信 ...

  6. 创建一个自定义的Application类

    由于每个应用程序必须创建一个Application对象,vs为开发人员提供了模板来减轻开发人员的重复工作.当使用vs创建一个WPF应用程序是,vs会自动创建一个app.xaml文件, <Appl ...

  7. javascript预编译和执行过程总结

    javascript相对于其它语言来说是一种弱类型的语言,在其它如java语言中,程序的执行需要有编译的阶段,而在javascript中也有类似的“预编译阶段”(javascript的预编译是以代码块 ...

  8. class文件反编译工具jd-gui下载地址

    https://github.com/java-decompiler/jd-gui/releases windows下载: 下载后打开软件,直接将jar包拖进去: 效果图非常美观:

  9. Spring_Spring与IoC_基于注解的DI

    一.基本注解的使用 (1)导入AOP的Jar包 (2) 与set()无关 二.组件扫描器的base-package 三.@Component相关注解 四.@Scope 五.域属性的注入 (1)byTy ...

  10. Android - 内存泄漏的情况以及解决方法

    [译]Android内存泄漏的八种可能(上) Android防止内存泄漏的八种方法(下). Static Activities 在类中定义了静态Activity变量,把当前运行的Activity实例赋 ...