-
Book Overview & Buying
-
Table Of Contents
jQuery UI Cookbook
By :
The spinner widget will happily let the user spin, indefinitely. It'll even change the display to use exponential notation when the JavaScript integer limit is reached, that's fine. Almost no application needs to worry about these limits. And in fact, it's probably best to put some limitations in place that actually make sense for the application. That is, specify a min boundary and a max boundary.
This works well, but it could work even better if we plug some logic into the spinner that handles overflow, when the user wants to go beyond the boundary. Rather than just stop spinning as is the default behavior, we just send them in the same direction, but starting from the opposite boundary. The best way to picture these constraints is by default, the spinner min-max boundary is like a straight line. We want to make it look more like a circle.
We'll have two spinner widgets, the first using the default boundary constraint logic, and the second using...
Change the font size
Change margin width
Change background colour