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

MediaClass updates can trigger incorrectly when elements are temporarily hidden #2

Open
gitastrophe opened this issue Jul 11, 2013 · 0 comments

Comments

@gitastrophe
Copy link

steps to reproduce:

  1. Invoke MediaClass with "this-max-width" predicate on an element with a fixed width, such that the predicate should not evalutate to true, e.g.
<script> var mc = new MediaClass("mobile", ".mobile-responsive:media(this-max-width: 100px)"); </script>
  1. observe that class "mobile" is not added to .mobile-responsive

  2. hide the div.mobile-responsive with "display: none;"

  3. blur the browser tab (click over to another browser tab)

  4. click back to the original tab

  5. show the div.mobile-responsive with "display: block;"

  6. observe that class "mobile" has been added to the div while it was hidden

suggestion:

  • Can you prevent the mediaLoop from being executed on elements with display: none?
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

No branches or pull requests

1 participant