O'Reilly logo

jQuery UI Cookbook by Adam Boduch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Controlling the step between values

There are several ways with which we can control the steps in the spinner widget. The step is the value that the spinner widget uses to move its number either up or down. For example, you'll often see loop code that increments a counter cnt ++. Here, the step is one and this is what the spinner step value defaults to. Changing this option in the spinner is trivial; we can even change this value after the widget has been created.

There are other measures we can take to control the stepping behavior of the spinner. Let's take a look at the incremental option and see how this impacts the spinner.

How to do it...

We'll create three spinner widgets to demonstrate the potential of the incremental option. Following is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required