简体   繁体   English

Selectivizr.js将无法在response.js中工作

[英]Selectivizr.js won't work in respond.js

I'm using Respond.js so that I can create a responsive page in IE8 . 我正在使用Respond.js,以便可以在IE8中创建一个响应页面。 And it works fine. 而且效果很好。

But, I am also using Selectivizr.js so that I can use CSS3 :nth-child selector in IE8 , which also works fine. 但是,我也使用Selectivizr.js,以便可以在IE8中使用CSS3 :nth-child选择器,它也可以正常工作。

The problem is that the nth-child selector won't work if it is in a responsive point . 问题在于,如果nth-child选择器处于响应点,它将不起作用。

For example, this won't work: 例如,这不起作用:

@media screen and (min-width:980px){

    .center_crni_linkovi a:nth-child(4n){
        margin:10px 0px 10px 10px;
    }

    .center_crni_linkovi a:nth-child(4n+1){
       margin:10px 10px 10px 0;
    }

}

But if I put the style outside the responsive point , it works fine. 但是,如果我将样式放在响应点之外,则效果很好。 But then I can't use a specific style for this specific responsive point . 但是然后我不能为这个特定的响应点使用一种特定的风格

How to make it work ? 如何使其工作?

A little late to the party, but if anyone else stumbles across this problem. 晚会晚了一点,但是如果有人偶然发现了这个问题。 It is a known issue with the current stable release of selectivizr when combined with respond.js. 当与response.js结合使用时,selectivizr的当前稳定版本是一个已知问题。 Use the latest build of selectivizr found here: https://github.com/keithclark/selectivizr/blob/master/selectivizr.js 使用在这里找到的selectivizr的最新版本: https : //github.com/keithclark/selectivizr/blob/master/selectivizr.js

Ensure you're loading selectivizr before respond.js and this should fix the issue. 确保您在response.js之前加载selectivizr,这应该可以解决此问题。

Update: 更新:

see also this: selectivizr2: Selectivizr with maintenance (more up to date) 另请参阅以下内容: selectivizr2:具有维护功能的Selectivizr (更多最新信息)

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

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