Ticket #86 (closed enhancement: fixed)
Animations using percent or ems
|Reported by:||bradleysepos@…||Owned by:|
|Keywords:||animations units fx||Cc:|
Description (last modified by john) (diff)
At some point it should be possible to retain the relative units when processing effects.
For instance, say I have an element that is set to 8em height via CSS. Let's assume for this example that 1em = 10px in the current document.
If we do a jQuery hide/show on this element, jQuery will measure the current height of the element in px, then perform the transitions also in px. The element will have a final size of 80px instead of 8em, and all transitions are performed using px and not a relative unit.
In short, jQuery should either perform the transitions using px and then return the element to the relative unit (em or %), or it should use the relative unit currently in use to actually perform the transitions.
Ideally, this would be optional for the programmer via a "use relative" parameter for FX. Likely, the script would have to parse the CSS to determine the original units used, then compare it against the current DOM properties to confirm that the element is still using a relative unit and has not been manually converted to px by another script. So there will be some checks involved to do it right, but in the end this would definitely be an amazing feature for liquid/elastic layouts.