-1

My goal is to create a scrollable wrapper CSS class that adds scrolling function to a list and it should show only 2 elements at a time. So i need to dynamically calculate the height of a div and then i'm thinking of setting the height of the scrollable wrapper as div height * 2. If there is a different approach them I am surely open to it.

.Scrollable_Wrapper {
   overflow-x: hidden;
   overflow-y: scroll;
   height: ;
}
kartik
  • 1
  • 1

1 Answers1

0
  1. using Javascript

document.onload = function() { var height = document.getElementsByClassName('header')[0].clientHeight; }

  1. Using Jquery:

    $(window).load(function() { $('.main').css('top', $('.header').height()); });

Gajanan
  • 454
  • 4
  • 11