Scrolling bar

Hi guys,

I am trying to build a scrolling bar to indicate the user how much has been scrolled on the page. I want to use it on my blog, on the post page.

I added a slider and I want to set the maximum value of the slider to the size of the page. Since the post page is like a dynamic page, I need to set the value on ready and update it with each location, but I am having big troubles to set the max size of the slider. This is the code I am using:

function initScroll () {
hight = postScroll()
    $w("#pageScrollIndication").min = 0;
    $w("#pageScrollIndication").max = 2500;
    $w("#pageScrollIndication").value = 0;
}
setInterval(function () {
    postScroll();
}, 100);

function postScroll() {
    wixWindow.getBoundingRect()
    .then((windowSizeInfo) => {
        $w("#pageScrollIndication").max = windowSizeInfo.window.height;
        let scrollY = windowSizeInfo.scroll.y;
        $w("#pageScrollIndication").value = scrollY;
    return windowSizeInfo.window.height
});
}

I have tried also using the windowSizeInfo.document.height, but the maximum value that scrollY can get is always bigger than the values I get from the document.height or the window.height

Does anyone have any idea how can I get the height of the page? Is that maybe a bug?

Thanks!

1 Like

The Wix Blog app is limited to what you can do with it through code.

https://www.wix.com/corvid/reference/$w.PostPage.html
https://support.wix.com/en/corvid-by-wix/wix-blog-with-corvid
https://www.wix.com/corvid/examples - choose the Blog section in the top menu for 6 examples.

I think you didn’t get my question.

That I am doing it on the post page doesn’t mean that it is related to the post page. It is the same if I would want to do it on any dynamic page. I want to get the document size of the page, so I could set the slider size.

It has nothing to do with the post page APIs

I have the same question about adding a scroll bar.

If your question is the same, there’s no need to ask it again. Post your own question here if it is related, or make a new thread if it’s only loosely related.

@gpsmaniacontact Did you have any luck with this? I’m interested in this feature as well!

This is an old post and I’m closing it.

If you have a question related to this issue, post a new question with details.