Relative value syntax (for .css() and .animate()) should support more mathematical operations
|Reported by:||mtaby@…||Owned by:|
Description (last modified by rwaldron)
Right now, you can set a css property relative to a current value. However, I think jQuery ought to support multiplication and division as well.
Use-cases for this vary, in my case, I want to set the scale (3d/2d transformation) relative to its current position, but scale is a multiplier, not a static value; You don't "add one" to a scale, you "multiply by 1.01".
Another use-case is when someone wants to double/triple the current value, same with halving, dividing, etc.
From my casual peek at the code, it seems like this would involve small changes to the rrelNum regex in css.js and some corresponding changes to the style() method.
Change History (11)
comment:1 Changed 5 years ago by addyosmani
- Component changed from unfiled to css
- Priority changed from undecided to low
- Status changed from new to open