IE8中Jquery“.append”的问题

时间:2012-10-01 00:10:48

标签: javascript jquery html jquery-plugins

好吧,我一直在尝试在IE8中使用“.append”时遇到问题,我的代码在所有浏览器(甚至IE9)中运行良好,但我遇到了IE8的问题..这是我的代码:

    divLine = null
    for(var i = ini; i < fim; i++ ){
       if(i % 5 === 0){
           var divLine = $("<div class='line' style='float:left;display:block;padding-top:25px;'></div>")
           $("#products").append(divLine)
       }
       if (linkI[i] != "semLink") {
       if (i != (4 + ini) && i != (9 + ini) && i != (14 + ini) && i != (19 + ini)) { 
          divLine.append("<div id='" + albuns[i] + "'style='float:left;display:block;'>" + 
         "<a href='" + url[i] + "'>" +
         "<img src='" + imagesUrl[i] + "' width='170' />" + "</a>" +
 "<div style='width:170px;'>" +
    "<h3 class='shout bare mts'>" +
       "<b>" + names[i] + "</b>" +
    "</h3>" + 
    "<h6 class='mbs'>" + 
        albuns[i] + 
    "</h6>" +
       "<a class='icons-comprar lfloat mtxs mrs' href='" + linkS[i] + "' target='_blank' >Comprar </br></a>" + 
        "<a class='icons-itunesSmall lfloat mtm' href='" + linkI[i] + "' target='_blank'>Itunes</a>" + 
  "</div>" + 
  "</div>" + 
    "<img src='http://assets.jumpseller.com/store/biscoitofino/themes/8055/space.png' width='30' style='float:left;display:block;'/>" +      
         "</div>")
          } else {
             divLine.append("<div id='" + albuns[i] + "' style='float:left;display:block;'>" + 
         "<a href='" + url[i] + "'>" +
         "<img src='" + imagesUrl[i] + "' width='170' />" +
"</a>" +
 "<div style='width:170px;'>" +
"<h3 class='shout bare mts'>" +
  "<b>" + names[i] + "</b>" +
"</h3>" + 
"<h6 class='mbs'>" + 
        albuns[i] + 
"</h6>" +
  "<a class='icons-comprar lfloat mtxs mrs' href='" + linkS[i] + "' target='_blank' >Comprar </br></a>" + 
  "<a class='icons-itunesSmall lfloat mtm' href='" + linkI[i] + "' target='_blank'>Itunes</a>" + 
         "</div>")
          }
      } else {
          if (i != (4 + ini) && i != (9 + ini) && i != (14 + ini) && i != (19 + ini)) {
          divLine.append("<div id='" + albuns[i] + "' style='float:left;display:block;'>" + 
         "<a href='" + url[i] + "'>" +
         "<img src='" + imagesUrl[i] + "' width='170' />" +
"</a>" +
 "<div style='width:170px;'>" +
"<h3 class='shout bare mts'>" +
  "<b>" + names[i] + "</b>" +
"</h3>" + 
"<h6 class='mbs'>" + 
        albuns[i] + 
"</h6>" +
  "<a class='icons-comprar lfloat mtxs mrs' href='" + linkS[i] + "' target='_blank' >Comprar </br></a>" + 
  "</div>" + 
  "</div>" + 
    "<img src='http://assets.jumpseller.com/store/biscoitofino/themes/8055/space.png' width='30' style='float:left;display:block;'/>" +      
         "</div>")
          } else {
            divLine.append("<div id='" + albuns[i] + "' style='float:left;display:block;'>" + 
         "<a href='" + url[i] + "'>" +
         "<img src='" + imagesUrl[i] + "' width='170' />" +
"</a>" +
 "<div style='width:170px;'>" +
"<h3 class='shout bare mts'>" +
  "<b>" + names[i] + "</b>" +
"</h3>" + 
"<h6 class='mbs'>" + 
        albuns[i] + 
"</h6>" +
  "<a class='icons-comprar lfloat mtxs mrs' href='" + linkS[i] + "' target='_blank' >Comprar </br></a>" + 
  "</div>" + 
  "</div>" + 
         "</div>")  
          }
      }
 }

其中:

 albuns = new Array();
 imagesUrl = new Array();
 url = new Array();
 names = new Array();
 linkS = new Array();
 linkI = new Array();

已经是服务器生成的排序数组。 我还在chrome和IE8中使用了输出的printcreens: IE8如下: enter image description here Chrome下面是: enter image description here

我们可以注意到IE中的输出完全失真了...... 这是有问题的网站: http://biscoitofino.jumpseller.com/catalogo

任何建议??? 提前谢谢!

0 个答案:

没有答案