How to create a switch button like Android with CSS?

Asked

Viewed 146 times

0

How can I create a switch button like the one on Android with CSS?

You need Javascript to do "on-off", or I can do this only with CSS?

Switch Igual Android

  • I think it’s really duplicated, the JS that has in the answer there does not interfere with the functionality of on/off. That’s what you were looking for?

  • @Sergio the only problem is that I wanted to do something that could be used with Angularjs (I no longer use jQuery). I saw on the Internet that some did without Javascript, using a checkbox with the attribute for (with hidden visibility). It would be interesting to have an answer from this one, don’t you think?

  • But your question is "You need Javascript to do "on-off", or I can do this only with CSS?" if you get a good look at the answer there is no Javascript at all: https://jsfiddle.net/o525zr7b/

  • You’ve wanted Angular for a while I made one in React :)

  • @Wallacemaxters a CSS-only example based on HTML attributes (properties), such as checked and disabled: https://answall.com/a/198805/3635

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.