<div class="txt" style="line-height:30px">我是文字<br>我是文字<br>我是文字<br>我是文字</div>
<script>
    //高度/行高=文本行数
    var rowNum=Math.round($(".txt").height()/parseFloat($(".txt").css('line-height')));
    alert("当前有"+rowNum+"行");
</script>

  

相关文章:

  • 2022-01-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2021-08-23
  • 2022-12-23
  • 2022-01-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案