为什么这个javascript停止刷新?

时间:2014-08-19 19:20:23

标签: javascript jquery html css

$(document).ready(function(){
  var highestBox = 0;
  $('#clubs .bcbox').each(function () {
    if ($(this).height() > highestBox) {
      highestBox = $(this).height();
    }
  });
  $('#clubs .bcbox').height(highestBox);
});

HTML是:

<div id="clubs">
  <div class="bcbox">short box</div>
  <div class="bcbox">A box with a lot of content, so that the heights aren't the same.</div>
</div>

每个.bcbox都是#clubs宽度的一半,但高度因内容而异。 它可以在大多数浏览器中使用,但是如果我刷新页面,则无法在Chrome中使用。

1 个答案:

答案 0 :(得分:0)

您的脚本可能正在缓存,请尝试在刷新之间清除缓存。

相关问题