Calculate div's slider console

Calculate div's slider console

Hello,

I'm trying to make my own vertical slider instead of using browsers default one.
So, I have .header which is fixed at top, and .footer which is fixed at bottom.

Between those, it's my div.main which has overflow and possible scrolling.

My question is, can I get only visible area of .main with height() or innerHeight, or whatever, or, it's only solution to use:

$(window).innerHeight() - $('.header').innerHeight() - $('.footer').innerHeight

I'm trying avoid these calculations and only get visible currently visible area of my .main

Best regards