GithubHelp home page GithubHelp logo

fklingler / jquery-touch-multiselect Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 4.0 299 KB

jQuery plugin to have a touch-fitted multi select input field.

License: MIT License

CSS 8.40% JavaScript 91.60%

jquery-touch-multiselect's Introduction

This jQuery plugin is able to transform a classic <select multiple="multiple"> input field of a form into a nice foldable list with easily selected elements, even for a touch device like a smartphone.

You can look at the demo folder to watch a working use of this plugin.

Usage

You can simply use this plugin by creating a standard <select multiple="multiple"> list :

<select multiple="multiple">
  <option value="1" selected="selected">Option 1</option>
  <option value="2">Option 2</option>
  <option value="3" selected="selected">Java</option>
  <option value="4">Option 4</option>
</select>

Then in a javascript script, you can simply use this function :

$('select').touchMultiSelect();

Parameters

Some parameters can be passed to the function to customize the behavior of the plugin :

  • noneButtonPresent
    Determines if a 'none' button must be included in the list
    default value : true

  • noneButtonText
    Determines the text of the 'none' button if there is one
    default value : 'None'

  • noneButtonAtBeginning
    Determines if the 'none' button must be prepended (true) or appended (false) to the list
    default value : true

  • permitNoSelectedButton
    If there is no 'none' button, determines if we can deselect an option if there is no other selected option
    default value : false

  • maximumNumberSelections
    Limits how many options can be selected; default is no limitation (null)
    default value : null

Example

$('select').touchMultiSelect({
  noneButtonPresent: false,
  permitNoSelectedButton: true
});

Information

This plugin has been made as a part of my work at Novelys.

License

MIT License. Copyright 2012 Novelys.

jquery-touch-multiselect's People

Contributors

fklingler avatar slimeygecko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jquery-touch-multiselect's Issues

Subsequent click handlers

As far as I can tell, trying to attach a click handler to any of the jquery-touch-multiselects is not possible. Are there any workarounds or solutions? I was a little confused as to why this is happening because as far as I can tell, you haven't used .stopImmediatePropegation anywhere in the plugin.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.