Book Image

Mastering jQuery UI

By : Vijay Joshi
Book Image

Mastering jQuery UI

By: Vijay Joshi

Overview of this book

Table of Contents (19 chapters)
Mastering jQuery UI
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a widget to display a slideshow


In the previous widget, we did not make use of callbacks. Most of the widgets require some type of custom callbacks. They provide more control to users and allow users to interact with the widget; for example, the built-in dialog. It provides options such as open, close, create, drag, and so on, which can be used to add dynamic behavior to the widget. Therefore, for our second widget, we will create the widget options as well as a callback. This will help you to understand widgets more thoroughly.

We will address this problem in our second widget, where we will convert a list of elements into slideshow. We will allow users to customize the widget by providing options to set the duration of a slide, the effect which will be used to show and hide the slides, the speed of slides, and so on. We will also provide a callback method. This callback will be called just before a slide is displayed.

Writing markup for slides

Let's start by writing the markup for...