私は2つの列を持つ翻訳/辞書のウェブサイトに取り組んでいます.1つはテキストを含み、もう1つは翻訳/別の言語の意味を含んでいます。ここで2つの無関係な外側のdivの内側のdivを同じ高さにするにはどうすればよいですか?
あなたはすべての列がテキスト/翻訳が含まれている内側のdiv要素が含まれて見ることができるように私が今 https://codepen.io/anon/pen/GMVrvR?editors=0100
HTML
<div class="chapter" style="direction: ltr;">
<p class="">
col#1
</p>
</div>
<div id ="left" class="lines" style="height: 532px; margin-right: -17px;" tabindex="0">
<div class="line" >
<span class="index-no">1</span><span class="">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu,Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula</span>
</div>
<div class="line" >
<span class="index-no">2</span><span class="">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo </span>
</div>
<div class="line" >
<span class=" index-no">3</span><span class="">parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu,Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula </span>
</div>
<div class="line" >
<span class=" index-no">4</span><span class="">. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc,</span>
</div>
<div class="line" >
<span class=" index-no">5</span><span class="">Sed fringilla mauris sit amet nibh.</span>
</div>
<div class="line" >
<span class=" index-no">6</span><span class="">Sed fringilla mauris sit amet nibh.</span>
</div>
<div class="line" >
<span class=" index-no">7</span><span class="">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu,Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula </span>
</div>
<p class="blank-line"></p>
</div>
</div>
</div>
<div class="block" style="width: 600px; height: 686px; ">
<div class="block-inner">
<div class="chapter" style="direction: ltr;">
<p class="">
col#2
</p>
</div>
<div id ="right" class="lines" style="height: 532px; margin-right: -17px;" tabindex="0">
<div class="line" >
<span class="index-no">1</span><span >Far far away, behind the word mountains, far from the countries Vokalia and Consonantia,</span>
</div>
<div class="line">
<span class="index-no">2</span><span class=""> A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth. Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of </span>
</div>
<div class="line" >
<span class="index-no">3</span><span class="">packed her seven versalia, put her initial into the belt and made herself on the way. When she reached the first hills of the Italic Mountains, she had a last view back on the skyline of her ho</span>
</div>
<div class="line" >
<span class="index-no">4</span><span class="">the first hills of the Italic Mountains, she had a last view back on the skyline of her</span>
</div>
<div class="line" >
<span class="index-no">5</span><span class=""> The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks </span>
</div>
<div class="line">
<span class="index-no">6</span><span class="">the first hills of the Italic Mountains, she had a last view back on the skyline of her</span>
</div>
<div class="line">
<span class="index-no">7</span><span class="">A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth. Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of!</span>
</div>
<p class="blank-line"></p>
</div>
</div>
</div>
を達成し何のためのペンです。私がする必要がどのような
は次のとおりです。のdiv#の
高さ:
は、列#1内のすべての内部のdivの高さを意味し、列#2における対応する内側のdivの高さに等しい作りますCOL#でCOL#1 =のdiv#2の高さのCOL#1 = COL#でのdiv#1の高さは2
と
のdiv#2の 高さ1 2 など
注意してください。
- テキストaデータベースから動的に作成された変換で、divのサイズを知ることができません。
- テキストの高さが翻訳の高さよりも大きく、翻訳の高さが大きい場合もあります。
- 2つの列にスクロールバーを残したいのは、ユーザーに1つの列のみをスクロールさせたり、2つの列を互いに同期させたりする機能を与えたいからです。 divは動作しません。 - 内部のdiv /ページが+300になるので、これを解決するためにjava-script/jqueryを使用する場合、速くなることを願っています。
したがって、対応するdivを同じ高さにするにはどうすればよいですか?
おそらく、同じ行に列を追加する必要があります。内部の左/右のdivを持つ1つのdivを意味します –
私は非常にあなたのコメントが好きではなかったことと、私は "これを解決するためにJavaスクリプト/ jqueryを使用する場合は引用します。 "いずれにせよ、私はあなたにリードを与え、あなた自身でそれを試し、あなた自身の書かれたコードで戻ってきます。たとえそれが失敗したとしても、少なくともあなたは何かを試みました。それをやり遂げる一つの方法があります。行の量が常に偶数の場合は、各行のIDを両方の列が同じになるように順番に並べると、それぞれの対応する列の最大高さを取得するためにjavascriptを使用し、次にjavascript css funcを使用してそれらのすべての高さ。 – Craig