How To Align Content Left Column Width Right Column - Question | JoomShaper

is live, now with multi-currency selling.

How To Align Content Left Column Width Right Column

MV

Mike Vanbelleghem

SP Page Builder 4 days ago

In sp page builder I have a section & 2 columns, the right column contains 2 picture above each other and the left column has a small text. How can I specify it so that the text always stays on top when I scroll down until it hits the bottom of the 2nd image ? it's a kind of sticky thx, Mike

0
7 Answers
Mehtaz Afsana Borsha
Mehtaz Afsana Borsha
Accepted Answer
Support Agent 4 days ago #234177

Hi,

Thanks for contacting us. There is no default option to do that, you have to customize it yourself. But I will give you a hint, it may help you.

This can be done with CSS using position: sticky.

Give the left column a custom CSS class, for example:

.sticky-column {
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

Then add sticky-column to the CSS Class field of the left column.

The top: 20px controls how far the text stays from the top of the browser window while scrolling.

One important point: the sticky element needs to be inside the same parent/section that contains the two columns. Also check that none of the parent containers has overflow: hidden, overflow: auto, or overflow: scroll, as this can prevent position: sticky from working.

If you want the text to stop exactly when the bottom of the second image is reached, the two columns should remain inside the same row/section. The sticky element will then stop at the bottom of its parent container.

For example:

.sticky-column {
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

This is generally the simplest way to achieve the effect in SP Page Builder without adding JavaScript.

-Regards.

0
MV
Mike Vanbelleghem
Accepted Answer
4 days ago #234178

Hi, just tried it, but it's not working, i added this code to the "custom css" in the settings of the left column, and above i added the sticky-column in the "css class", also checked the overflow, which is not set. any other suggestion ? regards

0
Mehtaz Afsana Borsha
Mehtaz Afsana Borsha
Accepted Answer
Support Agent 3 days ago #234243

You have to choose your sites CSS classes, then it will work. This blog will help you to find your CSS class name.

https://www.joomshaper.com/blog/which-line-of-css-i-have-to-edit-code-inspector-in-action

0
Mehtaz Afsana Borsha
Mehtaz Afsana Borsha
Accepted Answer
Support Agent 3 days ago #234258

Yes, Customizations fall outside our scope of support, so you will need to implement this custom code on your end.

Thank you for your understanding.

0
MV
Mike Vanbelleghem
Accepted Answer
3 days ago #234251

Dear, Ok, I'll have to dive into this, I tried to manually change it with the code inspector, doesn't work for the moment, as I'm not an expert I'll have to spend some (much) more time into it ... regards

0
MV
Mike Vanbelleghem
Accepted Answer
3 days ago #234265

Solved it, using chatgpt :-)

add this in the settings of the column : CSS Class = sticky-column

add this to custom code section of the template :

.body-innerwrapper {
    overflow-x: clip;
}
.sticky-column {
    position: -webkit-sticky;
    position: sticky;
    top: 80px;
    align-self: flex-start;
    height: fit-content;
}
0
Mehtaz Afsana Borsha
Mehtaz Afsana Borsha
Accepted Answer
Support Agent 1 day ago #234412

Glad to know that and thanks for accepting the answer.

0