A simple plugin for quickly creating styled selection boxes
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist
libs
src
test
CONTRIBUTING.md
LICENSE-GPL
LICENSE-MIT
README.md
grunt.js
jquery.selectionBox.jquery.json
package.json

README.md

jQuery Selectionbox

A simple jQuery plugin for quickly creating styled selection boxes

Getting Started

Download the production version or the development version.

In your web page:

<script src="jquery.js"></script>
<script src="dist/jquery.selectionBox.min.js"></script>
<script>
  $(function() {
    $('.selection-box').selectionBox();
  });
</script>

Documentation

Add the script after your stylesheet and jQuery, create your selection box form element, then initialize the selection box plugin.

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>jQuery Selectionbox</title>
  <script src="jquery.js"></script>
  <script src="dist/jquery.selectionBox.min.js"></script>
  <script>
    $(function() {
      $('.selection-box').selectionBox();
    });
  </script>
</head>
<body>
  <select class="selection-box">
    <option value="first">First</option>
    <option value="second">Second</option>
    <option value="third">Third</option>
    <option value="forth">Forth</option>
    <option value="fifth">Fifth</option>
    <option value="sixth">Sixth</option>
    <option value="seventh">Seventh</option>
    <option value="eighth">Eighth</option>
    <option value="ninth">Ninth</option>
    <option value="tenth">Tenth</option>
  </select>
</body>
</html>

Examples

http://dfadler.github.com/jquery.selectionBox

Release History

(Nothing yet)

License

Copyright (c) 2012
Licensed under the MIT, GPL licenses.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

Important notes

Please don't edit files in the dist subdirectory as they are generated via grunt. You'll find source code in the src subdirectory!

While grunt can run the included unit tests via PhantomJS, this shouldn't be considered a substitute for the real thing. Please be sure to test the test/*.html unit test file(s) in actual browsers.

Installing grunt

This assumes you have node.js and npm installed already.

  1. Test that grunt is installed globally by running grunt --version at the command-line.
  2. If grunt isn't installed globally, run npm install -g grunt to install the latest version. You may need to run sudo npm install -g grunt.
  3. From the root directory of this project, run npm install to install the project's dependencies.

Installing PhantomJS

In order for the qunit task to work properly, PhantomJS must be installed and in the system PATH (if you can run "phantomjs" at the command line, this task should work).

Unfortunately, PhantomJS cannot be installed automatically via npm or grunt, so you need to install it yourself. There are a number of ways to install PhantomJS.

Note that the phantomjs executable needs to be in the system PATH for grunt to see it.