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
When a checkbox is not displayed, switchery doesn't work well #23
Comments
I'm going through the same problem. |
I'll get into that in the next few days and fix it in the next version. |
Fixed in 0.5.1. Cheers. |
Thanks a lot! I have got one more idea. What about to call events from the switchery element on the source checkbox? If I use switchery for an existing app, I might have already some events attached on the checkbox. For inst. switchery would call onchange() on the checkbox if the state of switchery was changed and so on.... |
I'm not sure if I understand you correct, but currently an onchange event is triggered on the checkbox from the switchery element. There is an example on the demo page under the section "Checking state / On change". If you mean something else, please give me a more detailed example or some real-world situation, so that I could understand better. |
I meant exactly the same thing. Sorry, I had to overlook it. |
First of all, thank you for the plugin!
I just deal with an issue which is more problem of html and js itself, when the checkbox is not displayed, switchery doesn't work well:
The topic has been already discussed quite a lot:
http://stackoverflow.com/questions/1841124/find-the-potential-width-of-a-hidden-element
http://stackoverflow.com/questions/1472303/jquery-get-width-of-element-when-not-visible-display-none
I would say to clone and show and hide element is not really an elegant solution, if there are a really lot of checkboxes on the page it might be even performance issue, etc... But what about to add a parameter in settings in js, which would be used if the real width or height cannot be read?
I believe other users would appreciate this feature as well.
The text was updated successfully, but these errors were encountered: