Plugins

User login
Can't find a Plugin?

Can't find a Plugin you are looking for? Check out the jQuery Wiki page.

Are you a plugin developer? Please move your plugin over to this site.

Website Bug or Feature Request?

Found a bug on the new jQuery Plugin website? Have a feature request?

Submit it to the jQuery Plugin website issue queue to ensure it is noticed!

console reports conditional statements issues


Project:Color Animations
Version:1.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

hi!

i'm using the color plugin, and the console reports a few warnings, all
related to conditional statements.
As little i know about javascript, it appears to me this as incorrect coding
but i must be wrong since it was coded by John Resig and recently patched by Karl :)

function getColor(elem, attr) {
var color;

do {
color = jQuery.curCSS(elem, attr);

// Keep going until we find an element that has color, or we hit
the body
if ( color != '' && color != 'transparent' || jQuery.nodeName(elem,
"body") )
break;

attr = "backgroundColor";
* } while ( elem = elem.parentNode );*

return getRGB(color);
};

shouldn't it actually be

* } while ( elem == elem.parentNode );*

For that plugin, the console gives me more warnings for all lines like this
one:

if (result = /rgba\(0, 0, 0, 0\)/.exec(color))
return colors['transparent']

shouldn't it be:

if (result *==* /rgba\(0, 0, 0, 0\)/.exec(color))
return colors['transparent']

So, am i wrong this is incorrect coding ?