IE 9和JQuery innerWidth()

时间:2012-04-15 02:23:41

标签: javascript jquery html css internet-explorer

我一直试图在网上搜索一个明确的答案,但没有找到任何答案。

jQuery的innerWidth()是否可以在IE 9中运行?在我的代码中,使用innerWidth()会破坏js,因此html会显示其原始的css。如果我用'width()'替换所有'innerWidth()',那么代码会显示,但由于额外的填充,它不正确。

我的印象是jQuery的innerWidth()可以在ie9上工作(我在其他人的stackoverflow上读过甚至在ie8上使用它。有人可以确认jQuery()innerWidth()在IE 8上不起作用还是9?谢谢。

  // type 3: 2 columns of floated elements, pairs are equal heights
  // and last elmeent stretches to full width if an unmatched pair

  $('.links-with-desc.type-3').each( function() {
    $(this).innerWidth( maxWidth );
    $(this).children().each( function(i) {
      $(this).innerWidth( (maxWidth / 2) ).css('float', 'left');
      if(i == 0 || (i + 1) % 4 == 0 || i % 4 == 0) {
        $(this).css('background', '#161616').css('color', '#ddccdd');
        $(this).find('a').css('color', '#ffeeaa');
      }
      if((i - 1) % 3 == 0)
        $(this).css('background', '#ffeeaa');
      if(i % 2 != 0) { // odd number
        if($(this).prev().height() < $(this).height())
          $(this).prev().height( $(this).height() );
        else if($(this).prev().height() > $(this).height())
          $(this).height( $(this).prev().height() );
      }
      else { // even number (remember index starts with 0!)
        if($(this).hasClass('last'))
          $(this).innerWidth( maxWidth );
      }
    });
  });

0 个答案:

没有答案
相关问题