abpetkov / switchery

iOS 7 style switches for your checkboxes
http://abpetkov.github.io/switchery/
2.06k stars 479 forks source link

Touch support? #31

Closed drantunes closed 10 years ago

drantunes commented 10 years ago

There is an expectation for touch support?

abpetkov commented 10 years ago

Yes, touch events are supported. If you experience some issues on particular devices, feel free to share.

drantunes commented 10 years ago

Example?

abpetkov commented 10 years ago

Open the demo page in your mobile browser.

drantunes commented 10 years ago

lol A drag and drop feature is possible? For example, http://eightmedia.github.io/hammer.js/?

abpetkov commented 10 years ago

Of course not. It's a switch, what is there to drag and drop on a simple switch?

Switch states changes are triggered on click event, which on modern mobile browsers is interpreted as touch events. What I've only done is to optimize this whole thing by removing the 300ms default delay, by using Fastclick.

drantunes commented 10 years ago

Truth. I just confused because in native IOS checkbox, this feature of drag in drop exists.

faceyspacey commented 10 years ago

yea, it makes zero sense that u would make a replica of the iOS7 switch without the drag feature. come on now. It's totally possible. transforms (i.e. translateX) should have been used rather than transitions.