Prevent IE from throwing errors when setting RGBA values. Fixes #5509.

This commit is contained in:
Colin Snover 2010-10-09 10:42:01 -04:00 committed by jeresig
parent a2aefbf3b1
commit 2ca3659895
2 changed files with 16 additions and 2 deletions

View file

@ -88,7 +88,11 @@ jQuery.extend({
// If a hook was provided, use that value, otherwise just set the specified value
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
style[ name ] = value;
// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
// Fixes bug #5509
try {
style[ name ] = value;
} catch(e) {}
}
} else {