Skip to content

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

License

Notifications You must be signed in to change notification settings

spotlab/single.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

single.js

single.js is a user-friendly replacement for select boxes with single attribute inspired by multi.js. We have keeped the design of multi.js.

Check out the multi.js demo.

Installation

Via Yarn

yarn add spotlab/single.js

Or clone or download the repository to your project and include both files in the min directory.

<link rel="stylesheet" type="text/css" href="singlejs/min/single.min.css">
<script src="singlejs/min/single.min.js"></script>

Usage

single.js can be applied to any select element with the singleple attribute enabled.

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

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

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

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

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

License

single.js is licensed under MIT.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published