How to scroll to a page position?

Bubble provides the ability to capture the pages current scrolling position, but the workflow event scroll to only provides the ability to scroll to an element.

I thought about scrolling to the the header and then offset the pixels by the current page scrolling position as a workaround but the offset by pixels value doesn’t allow for dynamic data.

Does anybody know how to scroll to a page position?

I need this because when suing some HTML to stop the page scrolling and the user does this as they are halfway down a page reading an article, the page scrolls to the top in order for the page to stop scrolling.

Then when the HTML is removed through conditionals and the page can scroll again, it is starting from the top.

My goal is to scroll back to the position the user was at when the HTML came in and stopped the page from scrolling.

Or if somebody has a method to stop the page scroll so the page just ‘pauses’ at the current position and doesn’t scroll to the top of the page that would be awesom.

This is the HTML used to stop the scroll

#page{ position: fixed !important; }

I’m probably going to answer missing the point, but why not put an invisible item at the position you’re looking for and then redirect to that item?

@vnihoul77 that is my last ditch effort because I have no way of telling when or where the user will initiate the menu since it comes from a floating header.

So because of the innumerable possibilities of where in terms of page scroll position a user might trigger the HTML to stop scroll, I can’t place an invisible item in a static position.

What I would need to do is first change that invisible elements position to the current page scroll position, then trigger HTML and after removing the HTML to allow scroll I could potentially scroll to that invisible element.

That entire set up seems too cumbersome and I’m hoping to find a more simple solution.

+1 trying to do the same thing

@boston85719 did you end up using Scroll To?

Yes I did and it is working for me.

Need a 10ms pause for the stop scroll html to be lifted before running the JS

3 Likes

Hi,

Nice! Which plugin do you use to run javascript?

Toolbox plugin

Yes, the toolbox plugin.

@boston85719 this is great, thank you!

Hi,

I want to do this but for scrolling inside a repeating group not on the entire page.

I have 2 repeating groups and I want one of them to mirror the scrolling that the user does in the other.

I can get the scrolling position of the RG that the user manipulates by using RG Scrolling Position Detector Plugin for Bubble | Plugin for Bubble by Zeroqode.

I am just missing a way to make the other repeating group scroll to that position automatically. Putting it in terms similar to what your js code says, I want to do something similar to this:

repeating_group_X.ScrollTo(0, repeating_group_Y_position)

Any ideas would be helpful. Thanks in advance!

Inside of repeating groups it is not about scrolling to a position, but rather scrolling to an entry. If you can find a way to ensure the position of specific entries you could possibly get it to do it.

I’ve seen on the forum people discussing this recently…never followed so don’t know if solutions were provided.

1 Like

Yes, I think I can make it to scroll to a specific entry by detecting when this entry is visible by using this plugin Advanced Scrollspy / RG index Plugin | Bubble

However, I preferred the mirror RG to scroll to a specific position (pixel) in order to make the mirroring more precise. I thought that with a custom js like yours I could make it scroll to a specific position, I guess it is probably not possible.

Thanks anyways! :+1: