generates error when background color not first defined in CSS
| Project: | Color Animations |
| Version: | 1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | sawmac |
| Status: | active |
Jump to:
if you haven't already defined a background color for an element then try to animate the background color of that element (to create a highlight effect, for example) you end up with an error--fx.start isn't defined. This may make sense--but that isn't documented and with other effects libraries (like Scriptaculous) you don't need to set a background color first for the highlight effect to work (see http://wiki.script.aculo.us/scriptaculous/show/Effect.Highlight).
At the least, this should be documented in the code or in docs for plugin. But perhaps you can either 1. assume a white background or 2. pick up on the background color inherited by the element and use either of those as the starting background color.

Comments
#1
Thank you, probably never would have figured this out.
My experience on the matter: In Firefox, this works beautifully. In IE(7)? Not so much. As soon as the effect is invoked (in my case, by mouseover), the page throws an error (by showing the exclamation in the bottom left of the page, and not doing the effect at all).
Just make sure to declare a background for the thing your trying to fade beforehand, and you should be all set. Of course that's just my experience, not a guru by any means...