Sexy Combo jQuery plugin

Introduction

Sexy Combo is a jQuery plugin that allows you to turn default browser selectboxes into much more attractive and usable comboboxes. The user can choose whether to select option from the dropdown list or just type it. This widget reaches its maximum efficiency when we have selectboxes with lots of options (e.g. countries or states), so it would be difficult for users to find option in the huge list.

The plugin is usable not only for end users, but also for developers. Sexy Combo has a lot of configuration options so you can modify its behaviour and appearance. FRom this version the core CSS file is separated from the CSS that provides combo's appearance, and now you are able to easily create new skins for the plugin.

Examples

Please view demo page to see the possibilities of Sexy Combo.

Installation

Please follow these instructions to install Sexy Combo:

  1. Download and unpack the archive.
  2. Include jQuery and plugin files to your web page:
    	<script type="text/javascript" src="path_to_plugin/lib/jquery-1.3.2.js"></script>
    	<script type="text/javascript" src="path_to_plugin/lib/jquery.sexy-combo-2.0.js"></script>
    	
  3. Include core and skin CSS files to your page:
    	    <link rel="stylesheet" type="text/css" href="path_to_plugin/lib/sexy-combo.css" />
    	    <link rel="stylesheet" type="text/css" href="path_to_plugin/skins/skin_name/skin_name.css" />
    	    
  4. Done! Now make your selectboxes look and behave sexy!
    	$("select").sexyCombo();
    	

Usage and configuration options

Sexy Combo has a number of configuration options that are passed to the plugin in the form of JavaScript object, e.g. $("select").sexyCombo({triggerSelected: true});. The full list of options is:

Note that all callback functions are called in the scope of sexyCombo instance, so you have access to all of its methids / properties.

It is possible to create multiple comboboxes from which users can choose more than one option. All you need is to set "multiple" attribute of your selectbox to true, or set multiple config option to true if you create combo without selectbox. Currently this option does not work with autoFill config option. It will be fixed in one of the futute releases.

You are also able to create combos without using existing selectboxes. If you want to do this, you should use static method of jQuery.sexyCombo object named create, for example:

      $.sexyCombo.create({
          id : "id",
	  name: "name",
	  container: "#container",
	  data: [
	      {value: "1", text: "First option", selected: true},
	      {value: "2", text: "Second option"},
	      {value: "3", text: "Third option"}
	  ]
      });
      

Below is the list of configuration options for static creating of comboboxes. You can pass them to the create method together with options we have discussed above.

Appearance customization

In this version I have separated core CSS and presentational CSS, so now it's possible to create new skins for Sexy Combo. The download package contains one example skin. Feel free to create your own based on it.

Browser compatibility

Sexy Combo has been tested and works on the following browsers:

Support project

Every user of Sexy Combo adds some value to it, so you help me by just using it. However, if you want to help more, you can do the following:

Please don't donate money, it's needless.

Want to hire JavaScript programmer?

Please view my CV

Resources