-
Notifications
You must be signed in to change notification settings - Fork 477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can be done with pure CSS and less code #13
Comments
Of course it can be done in pure CSS. It's a matter of personal preference. Some people prefer to write 3 lines of JS, instead of 30 in CSS. |
OR you could refactor your version so that click events are properly emitted and your javascript gets reduced to just tweaking the css and generating the html instead of event binding. |
Thanks for your feedback, I find it very useful, especially from someone experienced like you. I'll consider it when making further changes to the component. |
@ProLoser thank you, that's rather elegant. |
So much better in CSS! thank you @ProLoser |
@ProLoser are you going to create a repo with your css solution? |
@damianof no because it's not something people should be including into their project as a 3rd party lib, just learn css. At best I would throw it on a tips and tricks collection |
Maybe a repo of CSS snippets.... |
…etkov/switchery#13 - Deleted the unused build\iservice\js directory
Hey @ProLoser , do you have a copy of this CSS you might share? unfortunately this jsfiddle seems to have been lost in the river of time. Thank you! |
@bobbyg603 Google "css switch" |
thanks @ProLoser i ended up finding one, here's the one i went with for anyone looking at this thread in the future https://codepen.io/TazTheManiac/pen/rGrpMg |
Here's a demo:
http://jsfiddle.net/ProLoser/bM4C9/
Doesn't require Javascript and should have excellent browser support. I tend to prefer declaring the colors in CSS instead of JS anyway.
The text was updated successfully, but these errors were encountered: