Comments (8)
Thanks, @nltesown :)
Supporting a true duration: 0
actually involves a series of hacks to avoid the requestAnimationFrame tick. It would likely be too considerable of a code reorg for me to implement.
However, I can make duration: 0
revert to 1 instead of 400. But, why is 1ms not satisfactory? What is your precise use case, if I may ask? I'd like to get an idea of use cases where someone would want to do this. There are likely more expressive ways to accomplish the same task.
from velocity.
Hi Julian,
In my idea of how it should behave (which is the way jQuery.animate
behaves, I think), a duration of 0 means that no animation runs at all. For that reason, duration: 1
is not OK because you actually run an animation (and generally get some unwanted flicker). I don't realize at all what it would imply for your code, but I figured it could be possible to simply skip any animation and directly set the final values... As for my use case: I'm translating some overflowing content within a container, and in some situations I need to directly jump from one position to another. I suppose it sounds vague or too specific, and it's true that I can find a workaround anyway... but in fact I was quite surprised when I followed the straightforward idea to set duration: 0
and saw that it didn't work as expected.
from velocity.
Have you thought about using forcefeeding to achieve the same jumping effect? If you forcefeed a start value, Velocity will immediately start at that point. No flickering.
http://velocityjs.org/#forcefeeding
If that doesn't solve your issue, I'll look further into implementing a feature like you're describing.
from velocity.
Thanks, I had not noticed this advanced setting, I'll have a look.
from velocity.
Actually, my first move was exactly the same (setting duration: 0). Maybe it would be more intuitive?
from velocity.
K. I'm going to change 0 to default to 1 instead of 400. This change will be pushed tonight. Thanks, guys.
from velocity.
Thanks a lot Julian!
from velocity.
A duration of 0 now defaults internally to 1ms instead of 400ms.
Update your copies of Velocity.
Thank you!
from velocity.
Related Issues (20)
- I accidently "pushed" two files into velocity HOT 2
- http://velocityjs.org/ insecure connection HOT 2
- Velocity 'registerNormalization' warning during Vue Unit Testing HOT 2
- Move to org HOT 1
- animation with property 'transfrom' in velocity does not work and an error appear instead HOT 1
- Security issue - How to report you about it ? HOT 3
- Animating scrollTop on scrollable elements HOT 4
- velocity ios transform do not work HOT 2
- Chaining produces error "e.replace is not a function." HOT 1
- VelocityJS: Missing pattern: padding
- VelocityJS: Missing pattern: padding HOT 2
- how to use velocity without jquery/zepto? HOT 1
- Velocity v3 and the future HOT 7
- Changing width and translate at the same time causes crash HOT 2
- scrollTop property not working as expected
- Is there a way to allow transition animation?
- How to easing like specialEasing of jQuery animate?
- Force velocity to attach itself to the window object even if jQuery is installed HOT 1
- The must-see 3D demo youtube video is private? HOT 2
- "This expression is not a callable" when instanciating Velocity HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from velocity.