jQuery UI Interaction : Selectable

This page discusses - jQuery UI Interaction : Selectable

jQuery UI Interaction : Selectable


jQuery UI Interaction : Selectable

Using jQuery Selectable plug-in , you can  make a group of element selectable. In the given below example, we are making list element selectable.

For options, events ,method and theming click here



<!DOCTYPE html>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui
/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui
<style type="text/css">
#feedback { font-size: 1.4em; }
#selectable .ui-selecting { background: #FECA40; }
#selectable .ui-selected { background: #F39814; color: white; }
#selectable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
#selectable li { margin: 3px; padding: 0.4em; font-size: 1.4em; height: 18px; }
<script type="text/javascript">
$(function() {

<div class="demo">

<ol id="selectable">
<li class="ui-widget-content">Element 1</li>
<li class="ui-widget-content">Element 2</li>
<li class="ui-widget-content">Element 3</li>
<li class="ui-widget-content">Element 4</li>
<li class="ui-widget-content">Element 5</li>
<li class="ui-widget-content">Element 6</li>
<li class="ui-widget-content">Element 7</li>


Output :

You can select element/elements by click and also by holding ctrl key or by holding left key of mouse :

Download Source Code

Click here to see demo

Learn from experts! Attend jQuery Training classes.