Skip to content
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

Support for custom checkbox elements (span) #25

Open
lockerbleiben opened this issue Aug 29, 2017 · 6 comments
Open

Support for custom checkbox elements (span) #25

lockerbleiben opened this issue Aug 29, 2017 · 6 comments

Comments

@lockerbleiben
Copy link

Hey,
i wonder if its possible to add functionality for "checkbox-overlapping spans"?!

e.g. <label class="option"><input type="checkbox"><span class="checkbox"></span> Option</label>

the span is a - css based- "checkbox lookalike"-span, while the original checkbox is invisible.

@rmariuzzo
Copy link
Owner

rmariuzzo commented Aug 30, 2017

@lockerbleiben how should it work? Can you provide some examples?

@lockerbleiben
Copy link
Author

Hey,
you can find a very common example under
http://doptiq.com/smartforms/v4/demos/templates/elegant/ui.html
another one:
https://mdbootstrap.com/components/inputs/
last but not least - material Design
http://material-components-web.appspot.com/checkbox.html

The Idea ist to hide a checkbox and replace it by a nice styled span oder label (wich almost has a class, which can be accessed)
e.g.
<label class="option"><input type="checkbox"><span class="checkbox"></span> Option</label>

So, maybe its possible to tell your script not to work with the checkbox itself instead of working with a given class of a given element.

@rmariuzzo rmariuzzo changed the title support for checkbox-overlapping spans Support for custom checkbox elements (span) Oct 12, 2017
@brando-online
Copy link

Im coming up against this with using the font awesome webfont too. Using something like this one on codepen: https://codepen.io/jamesbarnett/pen/yILjk

Holding back on doing the finger-friendly upgrade based on font awesome, because I really dont want to lose the features and simplicity of your plugin.

@thenitai
Copy link

thenitai commented Apr 2, 2019

Running into the same issue, but only realized now after weeks of re-design... Guess will need to look for something else :(

@allexnew
Copy link

I have exactly the same problem. If you replace the checkbox with a stylized image, the selection does not occur. Has anyone solved this problem?

@allexnew
Copy link

allexnew commented Dec 26, 2020

The script does not work if you use the "display: none;" element for the checkbox input.
If you use it like this:
.custom-checkbox { position: absolute; z-index: -1; opacity: 0; }
then everything works.

Exemple: https://dimox.name/custom-checkboxes-and-radio-buttons-using-css-only/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants