Skip to content

abdullah/multi.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

multi.js

multi.js is a user-friendly replacement for select boxes with the multiple attribute. It has no dependencies, is mobile-friendly, and provides search functionality. multi.js is also easy to style with CSS and optionally supports jQuery.

Check out the demo.

Preview of multi.js

Installation

Clone or download the repository to your project and include both files in the dist directory.

<link rel="stylesheet" type="text/css" href="multijs/dist/multi.min.css">
<script src="multijs/dist/multi.min.js"></script>

Usage

multi.js can be applied to any select element with the multiple attribute enabled.

var select_element = document.getElementById( 'your_select_element' );
multi( select_element );

To customize multi a few options can be passed with the function call. Below are all the default values.

multi( select_element, {
    'enable_search': true,
    'search_placeholder': 'Search...',
});

multi.js is fully native Javascript but also has jQuery support. If you have jQuery included multi can be applied to a select element as follows:

$( '#your_select_element' ).multi();

TODO

  • Native Javascript, no jQuery
  • Browser testing
  • Support for optgroups
  • Support for retrieving options by AJAX
  • Tests

License

multi.js is licensed under MIT.

About

A user-friendly replacement for select boxes with multiple attribute enabled

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 87.6%
  • CSS 12.4%