IE10 has dropped support for its DirectX image manipulations; it now uses the SVG standards. However, in Firefox, for example, you can apply an svg filter to any <img>
element but in IE10, and I can only seem to get it to work on images in <svg> <image ... /> </svg>
.
Do I need to write separate markup for different browsers? That seems wrong.
I tried using the CSS filters like -ms-filter
filter but none of those worked on IE10.
UPDATE 1:
Okay so I guess I may not have been particularly clear.
<!DOCTYPE html>
<style>
.pop {
filter: url(#pixelate);
}
.pop:hover {
filter: none;
}
.lol {
filter: url(#pixelate);
}
.lol:hover {
filter: none;
}
.svgRoot
{
height: 150px;
width: 200px;
}
</style>
<svg class="svgRoot">
<image class="lol" x="0" y="0" width="100px" height="100px" xlink:href="http://i.imgur.com/M5TIb.jpg" />
</svg>
<svg class="svgRoot">
<defs>
<filter id="pixelate">
<feMorphology operator="erode" radius="2" />
</filter>
</defs>
<image x="0" y="0" width="100px" height="100px" xlink:href="http://i.imgur.com/M5TIb.jpg" filter="url(#pixelate)" />
<text class="svgText" x="25%" y="90%" filter="url(#pixelate)">SVG text</text>
</svg>
<img src="http://i.imgur.com/M5TIb.jpg" width="100" class="pop">
In Firefox, the last element, the <img>
, the filter works. However, it doesn't in IE10. I could achieve the same affect here using IE4-IE9 with DX. effects. But IE10 implements SVG. However it only seems to work on elements contained within the <svg>
tag. So how am I to do any filter effects in IE10 without writing different markup? I feel like I must be missing something...
Hope this clears it up
filter
in CSS. Can you add a code sample to your question?<text>
is invisible), other browser have various problems displaying it. I usually use option 2 (define filters inside each<svg>
element), but I can't get it working this time.