I’m trying to get the CSS pseudo :nth-child(n) function to work in Internet Explorer and that isn’t an easy task.
I founded some JavaScript in jQuery to get the job done in IE but I can’t seem to get it to work. The examples I’ve tried is with unsorted lists (ul and li’s) but my CSS code (which works well in all other browsers) looks like this:
#portfolio div:nth-child(4) { some styling }
#portfolio div:nth-child(3) { some styling }
#portfolio div:nth-child(2) { some styling }
The javascript I tried to run by appending it to my existing script.js file is:
$('div#portfolio div:nth-child(4)').css({' filter:' : progid:DXImageTransform.Microsoft.Matrix(M11=0.99984770, M12=-0.01745241, M21=0.01745241, M22=0.99984770); ‘});
But that does not work. I’ve tried to remove the “div#portfolio” and retype it but nothing I do will make it work in IE.
Any help would be appreciated.
Sincere
– Mestika
Is that the exact code you are using, because the
nth-childpart is ok, the syntax for the.css()call is completely wrong.Drop the space and the colon from the first parameter (
'filter') and the second parameter has to be a string to.