Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get scroll Position Percentage

I need to be able to determine when the user has scrolled through 60% of the content in a panel and I'm not having much luck finding a solution for this.

Thanks in advance for any ideas.

like image 890
Johnie Karr Avatar asked Aug 23 '11 01:08

Johnie Karr


1 Answers

On Panel's Scroll Event, you can do

double scrollPercentage = (double) 
                scrollbar.VerticalScroll.Value / scrollBar.VerticalScroll.Maximum;

if (scrollPercentage > 0.6)
{
    ...
}
like image 65
Bala R Avatar answered Oct 10 '22 06:10

Bala R