html - How to put column of same height using overflow on one of them? -


hi i've search lot around cant find answer suit me. here problem:

i specify right i'm using bootstrap. have 2 columns working :

--------------------- | content  | aside1 | |          |------- | |          | aside2 | --------------------- 

the idea put content @ same height aside1 , aside2 incorporating overflow:scroll content.

html:

<div class="container-full">   <article class="col-md-8 col-xs-12">     <p>long content there</p>   </article>   <div class="aside_full_screen">      <aside class="col-md-4 col-xs-12">       <p>social network content</p>     </aside>      <div class="col-md-4 col-xs-12">       <p>kitten content</p>     </div>   </div> </div> 

css:

 article{    border: 2px solid black;   background-color: rgba(240, 116, 90, 1);   overflow: auto;   height: 1200px; /* — there example, had remove — */ }  ::-webkit-scrollbar {   /* — hiding scrollbar — */     display: none;  } 

here got. , here want achieve. little precision, scrollbar hidden. im open javascript jquery or kind of proposition.

on html add aside1 , aside2 so:

<div class="container-full">   <article class="col-md-8 col-xs-12">     <p>long content there: lorem ipsum dolor sit amet, consectetur adipiscing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.       duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. lorem ipsum dolor sit amet, consectetur adipiscing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam,       quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>   </article>   <div class="aside_full_screen">      <div class="col-md-4 col-xs-12 aside1">       <p>social network content</p>     </div>      <div class="col-md-4 col-xs-12 aside2">       <p>kitten content</p>     </div>   </div> </div> 

then can use jquery call function on document ready , window resize. inside function, need calculate .aside1 , .aside2 height height() function. apply total (aside1 + aside2) article.

jquery:

$(document).ready(myfunction); $(window).on('resize', myfunction);  function myfunction() {   var aside1 = $('.aside1').height();   var aside2 = $('.aside2').height();   var total = aside1 + aside2;   $('article').css("height", total); }; 

see example pen.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -