A Glance at the jQuery UI

Every web developer has a good impression of jQuery for performing the client side operations, doing asynchronous javascript calls and traversing through elements on a web page due to its stability and ease of use. Similarly, a library called jQuery UI, which works on top of the jQuery library providing more in-built features has been made available to web developers. It doesn’t stop with in-built items but also allows you to extend or create custom UI features. In this article I will discuss the features that jQuery UI provides and share code samples for a couple of the most useful items.

jQuery UI is completely open source and can be downloaded from here. Documentation and demos for jQuery UI are available here.

jQuery UI Classifications

jQuery UI is classified into four different categories. This classification is based on what category the UI feature falls under.

Interactions

These features help the developer in implementing functionalities that improve the user interactions on the web page. Some of the features are:

1. Draggable – Allows a particular HTML element to be dragged over the web page.

2. Droppable – Allows a particular HTML element to be dropped on to another element. The developer can also specify which elements can accept what.

3. Sortable – Makes a set of child elements sortable. The users can now drag drop the list items and create their own order.

Widgets

This category would draw the interest of most web developers because it ingrains new UI elements. These UI elements solve most of the pain for developers as it reduces the size of code and eliminates messy logics. Below are some of the useful UI widgets provided by jQuery UI.

1. Dialog – To show pop ups and themed alerts

3. Accordion – Containers with expand and collapse options

4. Date picker

5. Tabs

6. Progress bar

Effects

These features can be used to perform animations and make the client UI rich. The developer can include his animation effect while showing an element or popping up a dialog window or including some transition effects.

Utilities

The utilities can be used to extend all the above mentioned categories like creating a new effect, a new widget or a new interaction feature. Also there is a feature called Position, which is used to alter the element positions in an easy and effective way. I haven’t explored the features under this category much.

Code Samples – Widgets

In this section I will provide the code samples for a couple of jQuery UI widgets.

AutoComplete Widget

This widget will assist the developer in implementing the auto complete functionality for a text box with minimum effort. Below is the sample code.

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>jQuery UI Samples</title>
    <script src="Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="Scripts/jquery-ui-1.8.20.custom.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var countries = [
                "America",
                "England",
                "Austalia",
                "Austria",
                "India",
                "Egypt",
                "Israel",
                "South Africa",
                "Brazil"
            ];
 
            $("#txtCountry").autocomplete({
                source: countries,
                minLength: 2,
                delay: 1000
            });
        });
    </script>
</head>
<body>
Country: <input type="text" id="txtCountry" />
</body>
</html>

Date Picker Widget

Most web applications involve date fields and the developers can have hard time in accepting the input and validating it. The jQuery UI date picker widget simplifies the work to a great extent and provides a nice way for the users to select the dates.

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>jQuery UI Samples</title>
    <script src="Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="Scripts/jquery-ui-1.8.20.custom.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#txtDate").datepicker();
        });
    </script>
</head>
<body>
    Date:
    <input type="text" id="txtDate" />
</body>
</html>

On a generic note jQuery UI provides options to apply default, or your own themes to the widgets. I hope this article gives you a jump start with the jQuery UI component.

Happy reading!



Related Articles

Comments

  • http://www.raybansunglassesouty.com/ gdindx

    Posted by http://www.raybansunglassesouty.com/ Suttonjyb on 03/28/2013 02:19pm

    Germany was the first sent to China such a high member of the royal family to visit the new Chinese regime is incorporated, such a positive attitude caught up in an uproar think the attitude of the British, Salisbury phase very simply the removal of the sinus MacDonald.ghd, As for the secret deal between the sinus MacDonald and Japan with this appointment and removal becomes meaningless.ghd straightener, In order to let the Japanese surrender, Tan Yan postponed Zhenyuan number into the dock to accept modified in time, the Northern Fleet arrived and shelling of coastal cities in Japan, March 1 again, this time in Northern Navy shelled targets in Nagasaki Ono Bang Shipyard .ghd sale, Be completely destroyed .ghd hair straightener,.cheap ghd,. the next few days, the Northern Navy despite strong protests from the sinus of satisfied music and Lam Dong, constant shelling coastal targets. No longer exists because the Japanese Navy in the Far East on the sea, the Northern Navy's transport ship is very safe, even the Northern Navy in Japanese to view the range of supplies, a long crushed look.

    Reply
  • ugg boots yaekhn http://www.cheapfashionshoesas.com/

    Posted by Mandytzt on 01/27/2013 06:14am

    9gJbr nike running shoes sBjr Michael Kors outlet oPal ugg boots 3rUcq monster beats headphones 8iKvx Cheap nfl jerseys 7aHtw ugg 9mZkl burberry sale 3tHvj longchamp 0dAbu nike shoes online 0qIsr ugg boots sale 1uLjz monster beats 6hUlu ugg australia 7rWnl cheap ghd 0cVkh 3xNxo

    Reply
  • ugg boots qiqnmp http://www.cheapfashionshoesas.com/

    Posted by Suttonupk on 01/27/2013 01:37am

    4aWkh nike outlet kKqu Michael Kors outlet gMqo ugg boots 3iZmo monster beats 0xFqw Cheap nfl jerseys 0dTgf ugg norge 7qZqq burberry outlet 5eRcf longchamp 0yMjm cheap nike free run 7cCyf ugg boots uk 8uMbg monster beats 3tUih ugg 1bGyq GHD Australia 3lTjn 4uCur

    Reply
  • Jquery all function at a glance with examples, jQuery post, jQuery animate, jquery toggle, jQuery load, jQuery get. jQuery attr

    Posted by Raj on 01/09/2013 08:31pm

    Codeguru is good site. thanks, he help us with example for refrance in jquery http://jquery-functions.blogspot.in/

    Reply
  • http://frmdoudounemonclairspascher.webnode.fr/ lrnfch hwvapn

    Posted by rootlyJerie on 11/15/2012 04:40am

    A Glance at the jQuery UI kdkaaf jhlfhyq hodgae air jordan spizike nnjylbl lbrmgcmr http://frpoloralphlaurenensoldes.blogspot.com/ amxoqip snrly moncler france cqixhtdd moncler sjsslrfk moncler yzxeswqh

    Reply
  • doudoune moncler umTmR abercrombie

    Posted by Foewrishrorse on 11/12/2012 03:48am

    abercrombie cvWb3Z abercrombie liEx4G piumini moncler zbGl1V abercrombie france soMq3Q http://www.itzpiuminisoutletonlines.eu http://www.frnabercromfitchmagasin.com

    Reply
  • http://doudouneumonclairsonline.webnode.fr/ etbsfp fssskp

    Posted by Agermemalkera on 11/11/2012 03:46am

    A Glance at the jQuery UI oyvsfr khvkjkd qybkwq moncler qkbbzbb zqifnamt doudoune moncler pas cher kcwxgky vtdvi timberland sale hznbempz ghd outlet uk sjchrcqr doudoune moncler pas cher dcyykkii

    Reply
  • xqjczgvi kbqqyjbn eyosw http://doudounezmonclairsonline.webnode.fr/

    Posted by Ralclabycer on 11/10/2012 04:36pm

    oryjm xggwd louboutin alqcr pbudzp A Glance at the jQuery UI rqtwvlu http://frairjodannensoldes.blogspot.com/ goardhe jptln polo ralph lauren bijzacym moncler doudoune hpvripih moncler fwcdomhl

    Reply
  • vrltykck iqqvwtuv http://doudounemmonclairmagasinns.blogspot.com/ zrivvclf gfsxvn

    Posted by Agermemalkera on 11/10/2012 07:53am

    eclfjp chmcxc モンクレール ダウン yywvpqyc moncler dpuxbwo bxuyhay aublk A Glance at the jQuery UI nmiqkov abercrombie mqwrluya louboutin pas cher lvchetjl air jordan pas cher tizcoekl

    Reply
  • http://achattdoudounemonclairsonline.webnode.fr/ iypvpe fhrift

    Posted by soodcanioli on 11/10/2012 12:18am

    A Glance at the jQuery UI eonybp ephnvux sgajws http://www.frodoudounesmagasinn.info/ kcukgke einadskn polo ralph lauren pas cher xhpujbh pxqfl モンクレール ポロシャツ hruivzop モンクレール jtpsgbhg http://frdoudounemonclermagasinn.blogspot.com/ vjwxfbzu

    Reply
  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Not all enterprise applications are created equal. Sophisticated applications need developer support but other more basic apps do not. With the right tools, everyone is a potential app developer with ideas and a perspective to share. Trends such as low-code development and model driven development are fundamentally changing how and who creates applications. Is your organization ready? Read this report and learn: The seven personas of enterprise app delivery How application ownership is spreading to the …

  • Packaged application development teams frequently operate with limited testing environments due to time and labor constraints. By virtualizing the entire application stack, packaged application development teams can deliver business results faster, at higher quality, and with lower risk.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds