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

Add an option useful when animating #9

Merged
merged 1 commit into from Jan 28, 2016
Merged

Add an option useful when animating #9

merged 1 commit into from Jan 28, 2016

Commits on Dec 21, 2015

  1. Add an option useful when animating

    When animating the hide/show system, if hidden content is very large we'll see it disappear on first load (due to `max-height` transitionning).
    
    This code needs a `.js-first_load` class on `.js-to_expand` in `HTML`. Applying 
    ```
    .js-first_load {
      display: none;
    }
    ``` 
    will prevent the block to be drawn and then disappear (it won't be displayed at all). When the script is initializing, we already add a class on the `.js-to_expand`, so I just hooked on and remove the new `.js-first_load` class after `300 ms`(which is my `transition-duration`value). This value will ensure that no transition will be seen when loading the page.
    
    What's your opinion on this?
    
    It does work for me but I may have missed a point.
    ffoodd committed Dec 21, 2015
    Copy the full SHA
    1b6a05d View commit details
    Browse the repository at this point in the history