Guest User

Untitled

a guest
Nov 17th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.02 KB | None | 0 0
  1.     <div class="lighter bg" id="hero">
  2.         <div class="heropanel bg" id="first">
  3.             <div class="row">
  4.                 <div class="twelve columns">
  5.                     dongs
  6.                 </div>
  7.             </div>
  8.         </div>
  9.         <div class="heropanel bg" id="second">
  10.             <div class="row">
  11.                 <div class="twelve columns">
  12.                     more dongs
  13.                 </div>
  14.             </div>
  15.         </div>
  16.     </div>
  17.  
  18.     <script type="text/javascript">
  19.         function fixHeroSize() {
  20.             var hero = $('#hero');
  21.             var children = hero.children();
  22.             var height;
  23.  
  24.             hero.css('min-height', 0);
  25.             $.each(children, function(index, item) {
  26.                 $(item).css('min-height', 0);
  27.             });
  28.  
  29.             if($(window).height() > 768) {
  30.                 height = 400;
  31.             } else {
  32.                 height = 0;
  33.             }
  34.  
  35.             $.each(children, function(index, item) {
  36.                 var actual = $(item).height();
  37.                 if(height < actual) {
  38.                     height = actual;
  39.                 }
  40.             });
  41.  
  42.             hero.css('min-height', height);
  43.  
  44.             $.each(children, function(index, item) {
  45.                 $(item).css('min-height', height);
  46.             });
  47.         }
  48.  
  49.         fixHeroSize();
  50.  
  51.         window.onresize = fixHeroSize;
  52.     </script>
Add Comment
Please, Sign In to add comment