iPhone-Like Toggle Switches With Prototype
6
Aug
Elijah Miller is sharing a very nice script, inspired from the iPhone-style-checkboxes for jQuery by Thomas Reynolds, for creating iPhone-like toggle switches with Prototype.
It is a very flexible resource as:
- variable sizes of switches are created automatically
- has support for dragging
- sliding labels
- offers iPhone compatibility
How To Use It?
It converts the visual output of a checkbox & displays the standard checkbox when JS is disabled (unobtrusive).
To make it work, calling a simple function mentioning the ID of the checkbox & values is enough:
new iPhoneStyle('#variable_size_a_b', { checkedLabel: 'A', uncheckedLabel: 'B' });
That’s all.
Requirements: Prototype, Scriptacoluous
Compatibility: All Major Browsers
Website: http://jqr.github.com/2009/08/05/iphone-toggle-switc...
Download: http://github.com/tdreyno/iphone-style-checkboxes
Compatibility: All Major Browsers
Website: http://jqr.github.com/2009/08/05/iphone-toggle-switc...
Download: http://github.com/tdreyno/iphone-style-checkboxes
- Tags:
iPhone Javascript
- Filed under: Forms, Goodies, Other License
- 0 Comments
Related Posts
Leave a reply





















