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

Use margin instead of width to test for :change pseudo-selector #922

Merged
merged 2 commits into from
May 20, 2013

Conversation

tnajdek
Copy link
Contributor

@tnajdek tnajdek commented May 8, 2013

In Firefox it's not possible to adjust the width/height of the checkbox using css, hence the test would fail while support for :checked obviously exists. I suggest using margin-left and measuring offsetLeft instead, code attached.

@stucox
Copy link
Member

stucox commented May 12, 2013

Wondering if we should apply position: absolute to the #modernizr element, to ensure cb.offsetLeft is relative to it... then I think we could also use cb.offsetLeft == 20.

Thoughts?

@ryanseddon
Copy link
Member

Yeah makes sense to do that.

@tnajdek
Copy link
Contributor Author

tnajdek commented May 19, 2013

As suggested - updated this pull request, let me know if you have any other suggestions, cheers!

@stucox
Copy link
Member

stucox commented May 20, 2013

Nice one, thanks Tom.

stucox pushed a commit that referenced this pull request May 20, 2013
Use margin instead of width to test for :change pseudo-selector
@stucox stucox merged commit bb12a63 into Modernizr:master May 20, 2013
patrickkettner pushed a commit to patrickkettner/Modernizr that referenced this pull request Feb 22, 2015
Use margin instead of width to test for :change pseudo-selector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants