From jQuery JavaScript Library
« Back to the jQuery UI Docs
Plugin methods:Example:| Name | Type |
Basic Example of a selectable. (Draw a box with your mouse to select items.)
$("#myList").selectable();
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
$("#myList").selectable();
});
</script>
<style>ul { list-style: none; }
.ui-selected { background: #727EA3; color: #FFF; }
.ui-selecting { border: 1px solid #AAA; }
li { background: #CFD4E6; width: 100px; margin: 5px; font-size: 10px; font-family: Arial; padding: 3px; }</style>
</head>
<body>
<script src="http://dev.jquery.com/view/trunk/ui/ui.base.js"></script>
<script src="http://dev.jquery.com/view/trunk/ui/ui.selectable.js"></script>
<ul id="myList">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
</ul>
</body>
</html>