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. 用.net 2.0(或.net 3.5)开发的程序在.net 4.0的环境中运行的解决方案

    引用:.NET2.0程序集无法在.net 4.0 中运行的解决方案 1. 原来是在.net 2.0 (VS2008)的环境下的程序,通过升级到.net 4.0 (VS2013)导致程序运行不了 提示需 ...

  2. Java动态代理的理解

    代码内容: https://github.com/cjy513203427/Java_Advanced_Knowledge/tree/master/src/com/advance/dynamic_pr ...

  3. 我该不该学习C语言

    这几天把c语言过了一遍,基本上算是入门了,常用语法.函数的使用.c语言是比较古老的语言了,很多系统的底层.工业控制软件都是使用C语言编写,过一遍之后觉得c语言屹立不倒是有原因.c程序员有一句话:使用c ...

  4. 使用 Qt 获取 UDP 数据并显示成图片(2)

    本文首发于 BriFuture 的 个人博客 在我的前一篇文章 使用 Qt 获取 UDP 数据并显示成图片 中,我讲了如何用 Python 模拟发送数据,如何在 Qt 中高效的接收 UDP 数据包并将 ...

  5. POj2387——Til the Cows Come Home——————【最短路】

    A - Til the Cows Come Home Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & ...

  6. php.ini配置max_execution_time和FPM配置request_terminate_timeout

    PHP限定脚本执行时长的方式有几种,下面说下php.ini中的max_execution_time和php-fpm.conf中的request_terminate_timeout 1. php.ini ...

  7. JVM(三) 垃圾回收时间点和垃圾收集器

      收集器组合章节来自第一篇参考文章,非原创,作者总结地非常好!          分代收集相关概念来自参考文章第二篇,非原创         第二篇参考资料的文章质量很高,推荐阅读! 分代收集(Ge ...

  8. nodejs图片上传

    node中图片上传的中间键很多,比如formidable等,这里我们使用nodejs中的fs来实现文件上传处理: 1.安装中间键connect-multiparty npm install conne ...

  9. MySQL:ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

    错误 原因:可能是服务没有启动 以管理员身份打开cmd 输入 net start mysql

  10. 前端(一):html标签

    HTML(Hypertext Markup Language)超文本标记语言,它负责页面的结构.超文本指的是超链接,使用超链接可以从一个页面跳转到另一个页面. HTML的发展:1993年6月发布第一个 ...