Before starting, you must link JQuery UI's provided stylesheet for any of this to work!
<link href = "https://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel = "stylesheet">
Here, you'll find important and helpful resources on JQuery UI.
v
<link href = "https://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel = "stylesheet">
Any element can be made draggable with JQuery. Just use the following JQuery code:
$("selector").draggable();
Set up an ordered list with the ID "selectable"
Create a stylesheet with the following properties:
#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; }
Now just attach the following JQuery!
$("#selectable").selectable();
Any element can be a resizable element!
Add the "resizable" class to any element
<div id="resizable"><p>Any element can be a resizable element!</p></div>
Use JQuery's built in resize function.
$("#resizable").resizable();
This is an accordion! It's used as an efficient way of displaying information in a smaller amount of space.
Apply the "accordion" id to a parent div element
<div id="accordion"></div>
Use the built-in JQuery function to transform the div element into an accordion
$("#accordion").accordion();
Create an input and give it an ID like "autocomplete"
<input id="autocomplete">
Create a table in Javascript for all of the terms you'd like to autocomplete
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
Event
Create a div container with the ID "dialog," this will be the dialog box itself
<div id="dialog">
<p>Event</p>
</div>
After filling the div container with whatever content you like, use the JQuery UI library to transform it into a dialog box.
$("#dialog").dialog();
You can also hide/show the dialog box on command with a button. Here's a demonstration of how:
JQuery:
$("#dialog").hide();
$(".ui-dialog").hide();
$("#open").click(function() {
$("#dialog").show();
$(".ui-dialog").show();
});
HTML
<input type="button" value="click to open dialog" id="open">