//bsmSelectbyvicb

bsmSelect

A progressive enhancement to select multiple form elements using jQuery (fork of the asmSelect - http://www.ryancramer.com/projects/asmselect/)

129
36
129
6
JavaScript

bsmSelect - Better Select Multiple

based on asmSelect - Alternate Select Multiple by Ryan Cramer

Demo

bsmSelect demo

Usage

Include jquery, bsmSelect, and css in document head:

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.bsmselect.js"></script>
<link rel="stylesheet" type="text/css" href="jquery.bsmselect.css" />

Use a jQuery selector in your document ready function:

jQuery(function($) {
    $("select[multiple]").bsmSelect();
});

If desired, you can specify options when you call the plugin:

jQuery(function($) {
    $("select[multiple]").bsmSelect({
        addItemTarget: 'top'
    });
});

The newly created select default option is the original select title attribute:

<select name="cities" multiple="multiple" title="Please select a city">
...
</select>

Requirements

  • jQuery 1.4+ (you might need a newer version for IE9 compatibility)

Options

Primary Options

  • listType:

    • Specify what list will be created or used as part of the bsmSelect.
    • Can accept a callback that accepts the original .
    • Default: ‘bsmSelect’
  • listClass:

    • Class for the newly created list of listType (ol or ul).
    • Default: ‘bsmList’
  • listSortableClass:

    • Another class given to the list when sortable is active.
    • Default: ‘bsmListSortable’
  • listItemClass:

    • Class given to the
    • list items.
    • Default: ‘bsmListItem’
  • listItemLabelClass:

    • Class for the label text that appears in list items.
    • Default: ‘bsmListItemLabel’
  • removeClass:

    • Class given to the remove link in each list item.
    • Any element found in the
    • with this class will remove it.
    • If you give the
    • this class, clicking anywhere on the
    • will remove it.
    • Default: ‘bsmListItemRemove’
  • highlightClass:

    • Class given to the highlight .
    • Default: ‘bsmHighlight’

Authors and contributors

History

see history.md.

[beta]v0.13.0