I came across this control while using a webapp (this in invite-only beta) and liked the UI interaction. The webapp was built using prototype/scriptaculous, and we typically use jQuery when building our web apps.. my question is, has anyone seen a jQuery equivalent to this UI element?
A couple of the nice things I like about this approach, instead of the typical radioset approach, is the animated sliding effect of the switch button and still being able to slide on a double-click and the resize cursor.
Since I don’t have a working example of the element, I’ve attached a link to view a screen cap of it in action. 🙂
http://www.youtube.com/watch?v=kdyBodu4bSM
What I’m looking for is a jQuery plugin that can accomplish the same thing.. or a code snippet of something like this in jQuery.
Thanks!
Well, it’s certainly not easy to make yourself. Not easy, but quite fun. This is my first attempt at creating a plugin so please excuse the poor code quality. The code uses (but is not an extension of) jQuery UI. Specifically, it uses the draggable component for the handle, and some UI CSS classes.
This is certainly a work in progress. It is by no means finished. These are the things I’d like to see done before declaring this thing done:
The first two are very important, and is the reason why this code shouldn’t be used yet. You are, however, welcome to hack around the code and play around with it. All suggestions on how this thing might be made to work better are welcome.
Live demo: http://jsfiddle.net/RDkBL/7/