-
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
Treat 'visibility' like 'display' #9
Comments
Hey Tai! Thanks so much for this. I agree with you -- this is a logical extension of Velocity's display option. Here's the comparison I was looking for: http://stackoverflow.com/questions/272360/does-opacity0-have-exactly-the-same-effect-as-visibilityhidden Definitely gives me some perspective. |
visibility is a valuable option when the element still needs to keep taking up the space it normally does (therefore pushing other elements down) without being visible. there are many valid use cases with image galleries, drag+drop behaviors, hover effects, etc. |
I'm currently not really a user of velocity, but very interested and think, that this feature would be quite important. Here is another typicall usecase: Sometimes you also want to use visibility: hidden, even if you do not want to have extra space. For example in conjunction with google maps or other JS widgets, which needs to calculate offset/height, /width in those cases you can use visibility hidden in conjunction with height: 0/overflow:hidden as a wrapper. I really think this is a very good feature. |
+1 The differentiator for me is that events would automatically be disabled. Imagine you use velocity to transition Out a button in a button bar. On completion you don't want to abruptly and have the sibling buttons flow into it's place. If you just set opacity: 0 then the button can't be seen but can still be clicked. I suppose alternatively you could just disable the event on complete but then you'll need to re-enable it on begin. Also it seems like display:none and visibility:hidden are so closely related that the functionality is expected. Not sure how legitimate an argument that is though! |
Oh, right. Animating space collapsing. Yeah, that's pretty solid. I could see some powerful sequences being built on top of that. The delay so far in implementing this has been due to how convoluted it was to support Add in the fact that this could simply be accomplished manually by toggling However, enough use cases have been brought up that I'd like to see this through. I'll see what I can do to reduce bloat. |
I have amazing news, great people of Earth. This feature is landing tomorrow. |
This has now been integrated: http://velocityjs.org/#displayAndVisibility Please test and let me know if there are any issues. |
@julianshapiro To confirm adding visibility: visible to a fadeIn animation should change the visibility css attribute to visible before any animation starts allowing me to measure the height of the element? I'm currently seeing the opacity:0 and display:none. |
yup, please post a fiddle if you're having issues. would like to see it. ty! |
You can now set the `visibility` option just like you can `display`. See http://velocityjs.org/#displayAndVisiblity. Closes #9. Fixed bug that occurs with stagger + out transitions (from the UI pack). Closes #164. Thank you, @codedependant. You can now pass a function to the `stagger` option. Closes #163. Closes #162. Thank you, @codedependant and @cihadturhan.
It would be great if we could have a "visibility" option that behaves the same way as Velocity's "display" option - i.e. when set to "visible" it is applied up front, and when set to "hidden" it is applied at the conclusion of the animations.
Also, Velocity is great.
The text was updated successfully, but these errors were encountered: