Site logo

Archived topic

STICKY BLOCK WHEN SCROLLING DOWN

20 replies · Started by Yohann on March 2, 2023

Viewing posts 1–15 of 21

Hello, I use page hero header and sticky navigation.
I would like a bloc to be sticky under the header when scrolling down
How can I do this ?
Thank you

Hi there,

can you share a link to where we can see the block ?

you can see it on This page : page test

I want to 2 item to be sticky inter the header when scrolling down on desktop and mobile
Thank you for your help.

Which items will be sticky ?

both of them 'besoins" "solutions"

1. You've added the class .my-sticky-element to the block, but the . should not be included, please remove the ..

2. Then you can add this CSS to make theme sticky:

.my-sticky-element {
    position: sticky;
    top: 130px;
    z-index: 10000;
}

3. But you have this CSS which prevents elements to be sticky, you'll have to remove this CSS.

html, body {
    overflow-x: hidden;
}

4. The off canvas menu also adds this CSS which causes the same issue as no.3:

.offside-js--init {
    overflow-x: hidden;
}

You will have to add this CSS to override it:

body {
    overflow-x: unset !important;
}

It works only on desktop. Can you fix it on mobile also?
Thank you

No it is not sticky on mobile …

Thank you, it works.
But I used this code to prevent horizontal moving of the page on mobile :

html, body {
overflow-x: hidden;
}

So as I removed this code, do you know how I could fix this problem ?

Thank you,

Thank you, it works.
But I used this code to prevent horizontal moving of the page on mobile :

html, body {
overflow-x: hidden;
}

So as I removed this code, do you know how I could fix this problem ?

Thank you,

Where was the horizontal movement occurring as i don't notice it on the URL you shared?

How is the visual composer content added to the site ?
As it looks to be that content creating the issue.

This archived topic is closed to new replies.