Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Preface

Preface

Modern web application user interface design requires rapid development and proven results. jQuery UI, a trusted suite of official plugins for the jQuery JavaScript library, gives you a solid platform on which you can build rich and engaging interfaces with maximum compatibility, stability, and a minimum of time and effort.

jQuery UI has a series of ready-made, great-looking user interface widgets and a comprehensive set of core interaction helpers designed to be implemented in a consistent and developer-friendly way. With all this, the amount of code that you need to write personally to take a project from conception to completion is drastically reduced.

Specially revised for version 1.8+ of jQuery UI, this book has been written to maximize your experience with the library by breaking down each component and walking you through examples that progressively build upon your knowledge, taking you from beginner to advanced usage in a series of easy-to-follow steps.

In this book, you'll learn how each component can be initialized in a basic default implementation and then see how easy it is to customize its appearance and configure its behavior to tailor it to the requirements of your application. You'll look at the configuration options and the methods exposed by each component's API to see how these can be used to bring out the best of the library.

Events play a key role in any modern web application if it is to meet the expected minimum requirements of interactivity and responsiveness, and each chapter will show you the custom events fired by the component covered and how these events can be intercepted and acted upon.

What this book covers

Chapter 1, Introducing jQuery UI, lets you find out exactly what the library is, where it can be downloaded from, and how the files within it are structured. We also look at ThemeRoller, which browsers support the library, how it is licensed, and how the API has been simplified to give the components a consistent and easy-to-use programming model.

Chapter 2, The CSS Framework and Other Utilities, looks in detail at the extensive CSS framework, which provides a rich environment for integrated theming through Themeroller, or allows developers to easily supply their own custom themes or skins. We also cover the new position utility, as well as a whole section dedicated to writing your own jQuery UI plugins using the widget factory.

Chapter 3, Using the Tabs Component, looks at the first widget, which is the tabs component, a simple but effective means of presenting structured content in an engaging and interactive widget.

Chapter 4, The Accordion Widget, looks at the accordion widget, another component dedicated to the effective display of content. Highly engaging and interactive, the accordion makes a valuable addition to any web page and its API is exposed in full to show exactly how it can be used.

Chapter 5, The Dialog, focuses on the dialog widget. The dialog behaves in the same way as a standard browser alert, but it does so in a much less intrusive and more visitor-friendly manner. We look at how it can be configured and controlled to provide maximum benefit and appeal.

Chapter 6, The Slider Widget, provides a less commonly used, but no less valuable user interface tool for collecting input from your visitors. We look closely at its API throughout this chapter to see the variety of ways in which it can be implemented.

Chapter 7, The Datepicker Widget, looks at the date picker. This component packs a huge amount of functionality into an attractive and highly usable tool, allowing your visitors to effortlessly select dates. We look at the wide range of configurations that its API makes possible as well as seeing how easy common tasks such as skinning and localization are made.

Chapter 8, The Progressbar Widget, looks at the progressbar widget, examining its compact API and seeing a number of ways in which it can be put to good use in our web applications.

Chapter 9, The Button and Autocomplete Widgets, looks at the brand new button, and recently revivied autocomplete. Longtime users of the library will remember the autocomplete from a previous version of the library. The widget is now back, fully updated to fit in with the latest version of the library and in this chapter we get to see how it can be used to great effect.

Chapter 10, Drag and Drop, begins to look at the low-level interaction helpers, tackling first the related drag-and-droppable components. We look at how they can be implemented individually and how they can be used together to enhance your user interfaces.

Chapter 11, The Resizable Component, looks at the resizing component and how it is used with the dialog widget seen earlier in the book. We see how it can be applied to any element on the page to allow it be resized in a smooth and attractive way.

Chapter 12, The Selectables Component, looks at the selectable component, which allows us to add behavior to elements on the page and allows them be selected individually or as a group. We see that this is one component that really brings the desktop and the browser together as application platforms.

Chapter 13, The Sortables Component, looks at the final interaction helper in this chapter the sortable component. This is an especially effective component that allows you to create lists on a page that can be reordered by dragging items to a new position on the list. This is another component that can really help you to add a high level of professionalism and interactivity to your site with a minimum of effort.

Chapter 14, UI Effects, the last chapter of the book, is dedicated solely to the special effects that are included with the library. We look at an array of different effects that allow you to show, hide, move, and jiggle elements in a variety of attractive and appealing animations.

What you need for this book

All you need to work through most of the examples in this book is a simple text or code editor and a browser. One or two of the more advanced examples rely on PHP, but for convenience, I've put these examples up on my site for you to use if need be. You can find them at http://danwellman.co.uk/examples/jqueryui/.

Who this book is for

This book is for front-end developers who need to quickly learn how to use jQuery UI, or designers who wish to see how jQuery UI functions, behaves, and looks. To get the most out of this book you should have a good working knowledge of HTML, CSS, and JavaScript, and should ideally be comfortable using jQuery.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "When prompted for a location to unpack the archive to, choose the jqueryui folder that we just created."

A block of code is set as follows:

<link rel="stylesheet" href="development-bundle/themes/base/jquery.ui.tabs.css">
<link rel="stylesheet" href="development-bundle/themes/base/jquery.ui.theme.css">


					  

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

$(".ui-positioned-element").position({
of: ".ui-positioning-element",my: "right bottom",at: "right bottom"
});

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "When we view the page and select the Images tab, after a short delay we should see six new images".

Warnings or important notes appear in a box like this.


Tips and tricks appear like this.


Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to feedback@packtpub.com, and mention the book title via the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail suggest@packtpub.com.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at copyright@packtpub.com with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at questions@packtpub.com if you are having a problem with any aspect of the book, and we will do our best to address it.