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
fx_methods show() and hide() add unnecessary CSS properties on non-animated DOM nodes #445
Comments
I agree that, if there's no animation, there should be no changes to styles of the element. |
Also: The current fx_methods.js show/hide code changes the opacity in the case of a normal show() - I had a div with opacity set at .7, and it was re-set to 1.0 after the show(). I don't think my code is quite correct though. |
Up for this. Zepto should not change anything else than |
Up for this. (2) Same thing here! The 'transform' property realy cancels the 'fixed' positioned child elements, and for the 'absolute' positioned child elements, it acts like a 'relative' positioned element, preventing them to position themselves relative to their parent elements. My suggested solution is this:
Thus, by calling methods show() or hide() without the speed parameter setted, we exchanged only the 'display' property, and when the parameter is set, the event continues to be called the classic effect of element scale. |
This breaks Perhaps the code could temporarily store the original opacity value before an animated hide, so that Any takers to implement this? If so, a unit test for |
The |
When you add fx_methods to your Zepto, the show() and hide() methods are overriden with methods that also call animate. Even in the case of undefined speed (normal show), animate still adds many CSS properties to the shown/hidden notes, e.g.:
display: block; -webkit-transform-origin-x: 0px; -webkit-transform-origin-y: 0px; opacity: 1; -webkit-transform: scale3d(1, 1, 1); -webkit-animation-name: none; -webkit-transition-property: none; -webkit-transition-duration: initial; -webkit-transition-timing-function: initial; -webkit-transition-delay: initial;
These unexpected CSS rules can interfere with the page CSS (in my case, it has changed the positioning of my child fixed DIVs).
The equivalent jQuery methods do not call animate in the case of undefined speed, so I am currently experimenting with this change to the code:
The text was updated successfully, but these errors were encountered: