jQuery UI Spinner

After contributing jQuery Numeric Stepper to the jQuery UI community. Paul Bakaus kindly asked whether I’d like to merge it with the official jQuery UI Spinner, of which I was more than happy to do out of pure love for jQuery.

The jQuery UI Spinner widget will be available with the soon to be released jQuery UI v1.6.

Here’s a demo of the current incarnation.

Also, check out Subversion if you’re interested in getting the latest and greatest.

Update: this spin control is currently in re-design phase and will come under intense refactoring to be leaner and meaner. So the UI team have decided to push back its release to v1.next, which means it will not be part of the final 1.6 release. Sorry guys!

Update2: I’ve posted an update on this here.

16 Comments

  1. Jason at

    Looking great! If it's non-trivial, I suggest adding support for time. http://keith-wood.name/timeEntry.html does a decent job, but it seems like a natural addition to this plugin as well.

  2. caphun at

    @jason: interesting proposal. will definitely give this one some thought. :)

  3. Javi at

    Definitely what I was looking for :-) . I've tried the version included in JQuery UI 1.6RC1, and it seems to work great.

    My suggestion: make "stepping" and the number of decimals independent. For example, if I specified something like:

    { decimals: 2, stepping: 1 }

    Then two decimals would be displayed, but the number would be increased/decreased by one unit when the buttons are hit.

  4. caphun at

    @javi: that's a good suggestion. I think there are many use cases for this. It's pretty easy addition too! I'll get that into the spinner soon. Thanks :)

  5. caphun at

    @javi: I have added a decimals option to the SVN version. The latest is also here:

    http://yelotofu.com/labs/jquery/UI/spinner/ui/ui….

    Thanks!

  6. Javi at

    Thanks! I've just tried it, and it works great :-) .

  7. Den at

    This is a cool and useful widget.

    There's just one little thing. It doesn't feel natural to click the UP arrow to scroll DOWN a list, in my opinion.

    Perfectly natural for the numeric stepper, though.

    Congratulations.

  8. Wait, so was this released in 1.6 or not? Sorry for asking if you've already clarified somewhere, but I wasn't sure.

  9. I'm sorry, you did clarify that. You said it would not be in 1.6. I'm guessing it is not in 1.7 either, which is 1.6.7??

  10. Pawel at

    It's not working with jquery 1.3.2

    Do you have an easy fix

  11. caphun at

    @jon – the spinner has not been released yet but is very close now. It will most likely be part of 1.8 but no guarantees.

    @pawel – see, update2 above.

  12. Very interesting list. It’s a great addon to what I’m already doing. Thanks.

  13. Mahesh at

    Hw when i pressed tab for navigate between controls then text is not remain highlited.

  14. Emilio at

    Hi,

    Great work, thanks. I'm wondering if is possible to decouple the spinner with the jquery ui, i mean, not a widget…with the same functionality, of course, except theme rolling. I want use it but with my own icons, interface and so far…It's possible???

    kind regards

    • caphun at

      @emilio: that's certainly possible. The spinner originally functioned as a standalone widget before I moved it to UI. I might just pick that up again :)

  15. caphun at

    I have started a github project for jquery.spinner. Still early stage but does the basic stepping and paging and is ThemeRoller ready:

    http://github.com/caphun/jquery.spinner