Selectivizr
IE 6-8 的 CSS3 选择器
selectivizr 是一个 JavaScript 实用程序,它可以在 Internet Explorer 6-8 中模拟 CSS3 伪类和属性选择器。 只需在页面中包含脚本,其余的将由 selectivizr 完成。
要使用该库,您需要包括一个受支持的库:
- jQuery (1.3+)
- Dojo (1.5.0+)
- Prototype (1.6.1+)
- Yahoo UI Library (2.8.0+)
- DOMAssistant (2.8.0+)
- MooTools (1.3+)
- NWMatcher (1.2.3+)
然后在样式表后添加以下条件注释:
<!--[if (gte IE 6)&(lte IE 8)]> <script type="text/javascript" src="selectivizr.js"></script> <noscript><link rel="stylesheet" href="[fallback css]" /></noscript> <![endif]-->
这会将 selectivizr.js 和一个可选的 fallback CSS 文件添加到 IE6-8,同时对其他浏览器隐藏。