RickStrahl / jquery-watch

A jQuery plug-in to watch CSS style and attribute changes and get notified when a change occurs
MIT License
133 stars 31 forks source link

whitespace after comma in properties makes your watcher not work as expected #13

Open bm2u opened 8 years ago

bm2u commented 8 years ago

This works perfectly

...
el.watch({
    properties: "top,left,opacity,attr_class,prop_innerHTML",
    // rest of your code
    }
});

This not (only top property will be watched)

...
el.watch({
    properties: "top ,left, opacity, attr_class, prop_innerHTML",
    // rest of your code
    }
});

You can not do things like that in your callback function:

var propChanged = data.props[ i ],
if ( propChanged === 'attr_class') {...}