Block scroll

Hello !

Is there a way to block the scroll of the page for x seconds ? I have made a animation intro for my website but you can still scroll and go to th rest of the website.
Right now I used velo to not display sections till after the animation but It also happen when you change page and return to the homepage :confused:

Maybe it’s simpler to go a page with only the animations & then redirect to the a “real” main page ?


There are several ways. But the most efficient way depends on whether or not you have a premium account connect to your own domain (if you do, use custom element to set the style of the body & #SITE_CONTAINER to overflow-y: hidden!important; and pass a value to the custom element to remove this style once the video is done
. if you don’t - use setInterval(wixWindow.scrollTo(0,0), 20) and run clearInterval once the video is done, in the latter case the scrollbar will be displayed all the time you just won’t be able to scroll. In the first option, the scrollbar will be hidden during the video play time).
I already published several posts on the subject. Try to search the forum first.

Sorry ! i didnt find anything on this. It’s my first time using velo, so to be honest if you can give me a example of the first solution ( I have a premium account) that would be Awesome ! :grin:
Thanks again,

Thanks ! I think I understand how this works but not how to made it works. Like I said its the first time using velo and there is a pile of things I don’t understand even with the turotials. Like, HTMLElement is returning a error, where can I fix that ? I’ve seen that I must add someting to the tsconfig but again don’t really know how.
Thanks again a lot for your help

Add the code snippets I linked to the public/custom-elements folder in a new file.
Add the page code to the page.
Add a custom element to the page an configure its settings to point to the relevant custom code file with the custom element tag name.

Thanks again !

Almost everything work at perfection. I just don’t understand why every section I have is a HiddenCollapsedElement & I can’t use setAttribute on them :confused: neither can I on the page itself


sorry to respond again but I have not figured it out like I said in my other response :confused:
, in the worst case I will open a new subject for this.