1

I make virtual scrolling by using this fiddle.

I can not understand how to get the real scrollable height;

If I change row size, it doesn't work.

And the if I made small size, such as 200, it doesn't work,too.

var s = 20000000                // row size
var rh = 50;                    // row height
var th = rh * s;                // virtual height
var h =  1000000;               // real scrollable height
var ph = h / 100;               // page height
var n = Math.ceil(th / ph);     // number of pages
var vp = 400;                   // viewport height
var cj = (th - h) / (n - 1);    // "jumpiness" coefficient
dhilt
  • 18,707
  • 8
  • 70
  • 85
egaoneko
  • 389
  • 1
  • 5
  • 24

1 Answers1

2

Use $('#viewport')[0].scrollHeight this will give you a height of the scrollbar.

Here is the JSfiddle link : Click Here

Nimantha
  • 6,405
  • 6
  • 28
  • 69
chirag satapara
  • 1,947
  • 1
  • 15
  • 26