Reading Position Indicator

Hi everyone !!

In my website, I have made a reading position indicator. (Progress bar).

Here’s my code -

$w('#repeater1').onItemReady(($item, $itemData) => { 
$w('#footer1').scrollTo()
.then(() => {
  wixWindow.getBoundingRect()
  .then( (windowSizeInfo) => {
 let scrollX = windowSizeInfo.scroll.x;                
 let scrollY = windowSizeInfo.scroll.y;    
 
    $w('#progressBar1').targetValue =  scrollY;
    console.log(scrollY);
  } );
 $w('#header1').scrollTo();
 

} );
 

setInterval(() => wixWindow.getBoundingRect()
        .then( (windowSizeInfo) => {
 let scrollX = windowSizeInfo.scroll.x;                
 let scrollY = windowSizeInfo.scroll.y; 
           $w('#progressBar1').value = scrollY;               

       console.log(scrollY);
         } ) , 100);
         } );

Here when the items in the repeater are ready, it is scrolling down to the footer and setting the target value of the progress bar.

Is there any other way like

let scroll = $w('#page1').maxScroll;

I want to get the maximum scroll offset in the current page.

Thanks,
Ajith

Any??