karlhorky/gray

grayscalling on images after loading them via ajax

themca opened this issue · 2 comments

Hi,

I would like to add a grayscale on images wich i get over a ajax request. This doesn't work in my case.
I've tried to re-init the "gray" function after each request. but this hast no effect.

In the following screenshot you'll see 2 images, the one on the top is grayscaling correctly, and the logo, which is loaded via ajax is not:
https://www.dropbox.com/s/gdcvp3ydiotu76h/Screenshot%202017-11-15%2011.41.08.png?dl=0

This Screenshot is from the dom inspector:
https://www.dropbox.com/s/z63k1x8b543wtio/Screenshot%202017-11-15%2011.47.08.png?dl=0

Do you have any suggestions?

Regards
M.

Can be closed, had some wrong css statements, from a previous try, in my css file, therefore it wasn't working!
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); filter: gray; -webkit-filter: grayscale(100%);
now it works like charm ;)

Ok, sounds good. Glad you figured it out :)