設定されたdiv
幅の があり、span
その中にテキストが含まれています。スタイリング
#web_view_container
{
position:absolute;
top:100px;
left:100px;
width:306px;
height:202px;
overflow:auto;
}
.sentences
{
font-family:Georgia, "Times New Roman", Times, serif;
font-size:20px;
line-height:120%;
}
HTML
<div id="web_view_container">
<span class="sentences">Hello, This is last sentence This is last sentence This is last sentence This is last sentence This is last sentence.</span>
</div>
<span>
さて、これが実行された行数を取得するにはどうすればよいでしょうか。
私は改行文字を使用していないことに注意してください。
var lines = $('#web_view_container').html().split("\n");
alert(lines.length);
動作しません。
これは同じフィドルです。
誰かがこれで私を助けてくれませんか。ありがとう :-)