JoshBarr / on-media-query

A neat way to trigger JS when media queries change. No jQuery required.
283 stars 33 forks source link

Plugin fails in IE8 despite IE8 supporting CSS:after #1

Closed JoshBarr closed 12 years ago

JoshBarr commented 12 years ago

IE8 doesn't support the getComputedStyle method, and there doesn't seem to be a way of accessing pseudo-elements in IE, as the properties aren't really part of the DOM.

RiZKiT commented 12 years ago

Older IE versions support currentStyle(), but it doesn't support pseudo-elements.

http://ie.microsoft.com/testdrive/HTML5/getComputedStyle/

So you maybe find another alternative for adding pseudos, e.g. using font-weight on the head element, drawback here is you only have the values 100-900, so 9 variants for your responsive design.

JoshBarr commented 12 years ago

Maybe we could set an ID on the script tag, and apply font-family to it. Bit of a hack, but then again, all of these are hacks...

JoshBarr commented 12 years ago

Used a different HTML element to fix this issue. Now triggers in IE8 and 7. Untested in IE6 but no reason it shouldn't work there too.