How do I apply the following css code using jquery
#centeredImage
{
-webkit-filter: grayscale(20%) invert(0) blur(1px);
}
Already tried this, didn't work
$('#centeredImage').css('-webkit-filter','grayscale(20%) invert(0) blur(1px)');
Just use filter:
$('#centeredImage').css('filter','grayscale(20%) invert(0) blur(1px)');
jQuery automatically set prefixes.
You can use WebkitFilter instead:
$("#centeredImage").css({
WebkitFilter: 'grayscale(20%) invert(0) blur(1px)'
})
...css('WebkitFilter', ....