Search and Top Navigation
#4635 closed bug (duplicate)
Opened June 25, 2009 10:44AM UTC
Closed July 09, 2009 04:03AM UTC
Colour Animations cannot animate to transparent
Reported by: | willearp | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.8 |
Component: | ui.effects.core | Version: | 1.7.2 |
Keywords: | color animation | Cc: | |
Blocked by: | Blocking: |
Description
Effects.core.js cannot animate from the specified colour to transparent, which causes "Invalid Property Value" errors in IE7 and IE8. (FF seems to cope).
The library already has a function to look up the parent tree for the next value of the specified attribute, so the solution is to check whether fx.end is transparent and if it is, to lookup the next parent value using getColor(). Also it should only use "backgroundColor" as the attribute to retieve, as when looking up borders, the resulting parent color is black when the border width is 0. The code is as follows:
After:
fx.start = getColor( fx.elem, attr );
Add:
if (fx.end == "transparent") fx.end = getColor(fx.elem.parentNode, "backgroundColor");
Note: The fix for where fx.state could be greater than 0 even when fx.start and fx.end have not been initialised helps Internet Explorer's problems with this plugin too.
Change:
if (fx.state == 0) {
To:
if (fx.state == 0 || fx.start.constructor != Array || fx.end.constructor != Array) {
Attachments (0)
Change History (3)
Changed July 03, 2009 09:11PM UTC by comment:1
component: | ui.core → effects.core |
---|---|
milestone: | TBD → 1.8 |
Changed July 08, 2009 08:59PM UTC by comment:2
Actually I find it quite useful when animating backgrounds and borders on and off when you don't know what the colour you are animating to is, and it uses the function you already have for looking up parent colours, so all it is really doing is converting "transparent" to the next available colour.
Animating to some other color is certainly not a valid solutions for animating to transparent.