-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Help Wanted: Do a better job than me on the slideDown/slideUp sequences #96
Comments
@julianshapiro I will take this one |
I love you. Sent from my phone.
|
@julianshapiro :D 😊 |
Tried the snippet. Doesn't work for me either with my fork or latest Velocityjs release. Element[s] doesn't show up at all. Am I doing right? |
Could you please show me a JS fiddle of it not working? |
Got it, if element uses border-box box model, it fails. That's why it didn't work for me. |
Awesome :) One more thing to fix. |
Heyo! How's this coming along? Would you like any help? |
@julianshapiro still tweaking. The last time worked just fine, but then I tried it with a delay :/ Unit tests needed :) |
made a PR #121 |
We'll continue this discussion in the PR. |
Am I right in thinking that Velocity's support for slideUp/slideDown is only "vertical" as in "height" or can I also do it "horizontally" as in "width"? I haven't found a way to do that, could someone let me know if I missed anything? Cheers! |
Heyo! there's no way to do it horizontally :) Although feel free to code your own solution and share it with others if you're interested! You can tweak the current vertical solution. |
How can we prevent animation "stacking" when using "slideDown" and "slideUp"? In JQuery I used "stop"? Example (on click function): var elem = document.getElementById('#test'); |
The simple answer is by using Velocity(elem, 'stop'). The long answer is that I just tried it and it causes some issues with caching heights if used before an animation has been completed. |
Yes, I have tried that. Animation is messed up then. |
@MattyBalaam Did you find a solution to prevent the animation "stacking" which didn't cause the height caching issue? Thanks in advance. |
Velocity's packaged slideUp/slideDown sequences are ugly. They're the only part of Velocity's codebase that I don't like: https://github.com/julianshapiro/velocity/blob/master/jquery.velocity.js#L2681
To tackle recoding them, you'll first need to read the docs on Sequences (http://VelocityJS.org/#sequences) and
display
toggling (http://VelocityJS.org/#display).Next, here's a snippet you can use to quickly test your fork. Make sure this runs the same in your fork as it does in the current version of Velocity:
If you have any questions about why the current slide sequences are coded they way they are, ask here. It would be my pleasure to expand on my existing decisions (which I don't think are necessarily very sound).
Two things I'll preemptively point out:
Finally, I'm looking for an enhancement: Don't re-trigger the slideDown animation if the element is already visible. Likewise, don't re-trigger slideUp if the element is already hidden.
The text was updated successfully, but these errors were encountered: