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. 批量插入Oracle,遇到CLob字段慢的解决办法

    在一次执行批量插入到Oracle表,其他一个字段设置为CLOB,但没有内容,在插入时,在代码指定为CLOB类型,插入相当慢,后来改为VarChar2,速度就上去了,经测试,插入一个65535个字符,没 ...

  2. linux下查看memcache版本

    用telnet 127.0.0.1 11211命令连接上memcache, 然后直接输入stats就可以得到memcache服务器的版本

  3. html元素两种分类。替换元素和不可替换元素;块级元素和行内元素

    根据元素本身特点来分类: 替换元素替换元素根据其标签和属性来决定元素的具体显示内容.有<img><input><textarea><select>< ...

  4. golang 使用rrd的相关资料

    一.简介      RRDtool是指Round Robin Database工具,即环状数据库.从功能上说,RRDtool可用于数据存储+数据展示.著名的网络流量绘图软件MRTG和集群监控系统Gan ...

  5. SZU 7

    A - Megacity sqrtf是个坑 #include <iostream> #include <string> #include <cstring> #in ...

  6. 小白学flask之路由,反向路由,路由参数

    # -*- coding: utf-8 -*- from flask import Flask, request, url_for app = Flask(__name__) @app.route(& ...

  7. 洛谷P3952 时间复杂度(模拟)

    题意 题目链接 Sol 咕了一年的题解..就是个模拟吧 考场上写的递归也是醉了... 感觉一年自己进步了不少啊..面向数据编程的能力提高了不少 #include<bits/stdc++.h> ...

  8. VScode设置jsx语法自动补全

    1.打开VScode 2.文件>首选项>设置 3.加上以下配置项就可以了 "emmet.includeLanguages": { "javascript&qu ...

  9. Android蓝牙自动配对Demo,亲测好使!!!

    蓝牙自动配对,即搜索到其它蓝牙设备之后直接进行配对,不需要弹出配对确认框或者密钥输入框. 转载请注明出处http://blog.csdn.net/qq_25827845/article/details ...

  10. ArcGIS DataStore手册——入门篇

    第一章:ArcGIS DataStore入门 1.ArcGIS DataStore简介 ArcGIS DataStore是ArcGIS10.3推出来的一个全新的组件,它是一个关系型数据库管理系统,用于 ...