我正在使用CSS负责地处理浮动框,我的目标是使其在Internet Explorer 7和8中都能工作。我可以在Jquery中实现吗?

如果有人可以提供帮助,那将是巨大的帮助!

这是我的小提琴。请更新 :)

http://jsfiddle.net/ZuJW2/

/* =============================================================================
BOXS RESPONSIVE
========================================================================== */

#examples {
  width: 100%;
  max-width: 970px;
  margin: 0 auto;
}
#examples ul {
  width: 100%;
  overflow: hidden;
  *zoom: 1;
}
#examples ul li {
  float: left;
  margin-right: -100%;
  width: 100%;
}

#examples ul li a:hover {
  text-decoration: none;
}

#examples ul li span {
  font-size: 16px;
  line-height: 22px;
  display: block;
  padding-bottom: 30px;
}
#examples ul li img {
  width: 100%;
}
#examples ul li:nth-child(1n+1) {
  margin-left: 0%;
  margin-bottom: 3.85%;
  clear: both;
  overflow: hidden;
  *zoom: 1;
}

@media screen and (min-width: 460px) {
  #examples ul li {
    float: left;
    margin-right: -100%;
    width: 48.08%;
  }
  #examples ul li span {
    padding-bottom: 10px;
  }
  #examples ul li:nth-child(2n+1) {
    margin-left: 0%;
    margin-bottom: 3.85%;
    clear: both;
    overflow: hidden;
    *zoom: 1;
  }
  #examples ul li:nth-child(2n+2) {
    margin-left: 51.93%;
    margin-bottom: 3.85%;
    clear: none;
  }
}
@media screen and (min-width: 700px) {
  #examples ul li span {
    padding-bottom: 10px;
  }
}
@media screen and (min-width: 900px) {
  #examples ul li {
    float: left;
    margin-right: -100%;
    width: 22.11%;
  }
  #examples ul li span {
    padding-bottom: 0px;
  }
  #examples ul li:nth-child(4n+1) {
    margin-left: 0%;
    margin-bottom: 3.85%;
    clear: both;
    overflow: hidden;
    *zoom: 1;
  }
  #examples ul li:nth-child(4n+2) {
    margin-left: 25.96%;
    margin-bottom: 3.85%;
    clear: none;
  }
  #examples ul li:nth-child(4n+3) {
    margin-left: 51.93%;
    margin-bottom: 3.85%;
    clear: none;
  }
  #examples ul li:nth-child(4n+4) {
    margin-left: 77.89%;
    margin-bottom: 3.85%;
    clear: none;
  }
}

最佳答案

使用Modernizr处理IE7和8。

关于javascript - 流体布局在Internet Explorer 7和8中不起作用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/19633402/

10-11 05:54