简体   繁体   English

IE8条件javascript无法链接

[英]IE8 conditional javascript not linking

here's a landing page I've coded up: 这是我编写的登录页面:

http://rsa-partner.com/ http://rsa-partner.com/

It all looks fine in every browser bar IE8. 在每个浏览器栏IE8中,一切看起来都不错。 In IE8, the advanced CSS selector 'nth child' is not recognised. 在IE8中,无法识别高级CSS选择器'nth child'。

I downloaded and linked selectivizr.js ( http://selectivizr.com/ ), which should have sorted it in ie, but alas, the background images that show on all my nth child selectors are not showing. 我下载并链接了selectivizr.js( http://selectivizr.com/ ),该文件应该已经对其进行了排序,但是,可惜,第n个子选择器上显示的背景图像没有显示。 The code is 该代码是

<!--[if (gte IE 6)&(lte IE 8)]>
<script type="text/javascript" src="js/selectivizr-min.js"></script>
<![endif]-->

Is there something I'm missing? 有什么我想念的吗? I swear I've used conditional IE specific comments before and got nothing back. 我发誓我之前使用过条件IE特定注释,但一无所获。 Any suggestions would be much appreciated. 任何建议将不胜感激。

Of course I could simply remove my nth child selectors and replace with specific classes but I'd like to avoid that if possible! 当然,我可以简单地删除第n个子选择器,并替换为特定的类,但如果可能的话,我想避免这种情况!

If your content is loaded in dynamically (like if you are using a CMS system), then it gets loaded after Selectivizr is run, and therefore it won't work. 如果您的内容是动态加载的(例如,如果您使用的是CMS系统),那么它将在Selectivizr运行之后加载,因此它将无法正常工作。

From selectivzr.com : 来自selectivzr.com

The emulation is not dynamic. 仿真不是动态的。 Once the styles are applied they are fixed so changes to the DOM won't be reflected. 一旦应用了样式,它们就会被固定,因此不会反映对DOM的更改。

I recommend using Modernizr instead. 我建议改为使用Modernizr You can check for css-lastchild and customize the styles if the browser doesn't support it (together with the rest of the CSS3 selectors, like nth-child , etc.). 您可以检查css-lastchild并自定义样式(如果浏览器不支持)(以及其他CSS3选择器,如nth-child等)。 I share your pain though! 我也分享你的痛苦!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM