Skip to content

Instantly share code, notes, and snippets.

@marklchaves
Last active November 24, 2021 11:21
Show Gist options
  • Save marklchaves/31bbb2ad973e533a4863f9eacf0277c7 to your computer and use it in GitHub Desktop.
Save marklchaves/31bbb2ad973e533a4863f9eacf0277c7 to your computer and use it in GitHub Desktop.
How to Create a Floating Column Using CSS position: sticky in Avada

Usage

  1. Create your columns in Fustion Builder.
  2. Select the column you want to be sticky.
  3. Add floating-toc to the CSS Class setting for the column you selected.
  4. Add the following CSS to the page's CSS editor.
/** Add this to your page's CSS */
.floating-toc {
  position: sticky;
  top: 171px; /* Offset for the header. Adjust as needed. */
}

See the screengrabs in the comment below this gist.


References

How to add CSS to WordPress

Live demo on CodePen

CSS position on MDN


ko-fi

@zoudano
Copy link

zoudano commented Mar 7, 2021 via email

@marklchaves
Copy link
Author

Hello @zoudano,

Excellent! I'm glad it's working now :-)

Sure, I'd like to learn more about your projects to see how I can help.

Can you please send me a message via the contact form on my website? The link to my website is on my profile @marklchaves.

Have a great weekend :-)

Mark

@Wordpresslover
Copy link

Hi, That sollution does not work with me @marklchaves Could you please take a look at my code? Here is the test page: https://rekinfinansow.pl/rekin-finansow-bije-rekordy-popularnosci/

@marklchaves
Copy link
Author

Hey @Wordpresslover,

Sorry for the delay. I just visited that page. I can see a sticky column on the right-hand side. It seems to work fine for me.

Let me know if you have any questions :-)

Thanks!

@jolution
Copy link

The class "position-sticky" with the information above worked as soon as I changed the parent div #boxed-wrapper from overflow:hidden to overflow:visible.

@marklchaves
Copy link
Author

Hey @jolution,

Excellent! Thanks for sharing that with everybody :-)

@Paeddy85
Copy link

Hello
I have the same problem. I installed the Avada theme and would like to add the sticky position to a column. I've tried all of the above solutions but none of them work.

The left graphic should stay when you scroll down.

You can see all the settings of the container and the column on the print screen.

What am I doing wrong?

Thank you very much for your feedback

Bild1

Container 1
Container 2
Container 3

Column 1
Column 2
Column 3

@Wordpresslover
Copy link

Wordpresslover commented Nov 23, 2021

@Paeddy85 no such built=in option in Avada. Avada has only sticky containers. For me Mark's css works:

  1. add css to you specific page or globally if you use it in many places.

/** Add this to your page's CSS /
.floating-toc {
position: sticky;
top: 171px; /
Offset for the header. Adjust as needed. */
}

  1. just add a class .floating-toc to your column and it should work.
  2. Report to Avada the need of a sticky column feature.

@Paeddy85
Copy link

@Wordpresslover Thanks for your answer. I've already tried this, but it doesn't work. What about the container settings are they right?

Bild1

Bild2

Angebot.Uberbauung.Bomus.-.Google.Chrome.2021-11-24.08-27-21.mp4

@Wordpresslover
Copy link

@Paeddy85 That's perrfectly okey wht you did. In your case an extra custom work is necessary though. If you want me to help you please contact me: https://companyromania.com/contact-us/

I will need a login to your test site to solve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment