In this tutorial, I will show you how to toggle open and close the Elementor Tabs and the Accordion elements, by scrolling the page normally.
So we are switching the active tab or accordion based on the scroll position. Clicking the tab or accordion title still works just fine too.
See the demo here:
Here is a more complex layout, where an outer accordion toggles content that itself include accordions that swap images on change. The image swapping part comes from this free tutorial: Elementor Tabs & Accordion Image Switcher
Features:
- Polyvalent: This uses the new Tabs and Accordion elements, so you can have any element in there
- Customize as you wish: Elementor as normal to style the tabs and accordions and their content
- Desktop only: While this actually works everywhere, because the parent container is sticky, all of your content has to fit within 100vh, as you can't scroll down to reach to the rest of the content (scrolling down brings everything down!). So if you have a lot of content in there, it's better to just revert back to normal on mobile (as in the demos). If you don't have much content in there, this works on mobile too.
Let's get started!
First, import the template on your page
This is a premium tutorial. Purchase access to unlock the full tutorial.
14 Responses
When I scroll the page on my monitor in Windows using Chrome, all the items that are fixed when scrolling keep changing position 1px up, then 2px down, 1px up again and appear to be shaking.
how to solve this? I tried with Willchange: transform, but without success.
Hey Orlando!
Do you also see this in my demo?
I see what you mean, but this seems to be an iFrame bug... I can only see it in the iframe of the demos, not directly on the demo page: https://templates.element.how/elementor-sticky-toggling-on-scroll-sections-template/
How about you?
I have purchased the code, but it is not working at all.
Greetings Tech!
Could you share the URL where you imported the template? I will have a look.
Is the problem that it's not sticky?
If for some reason your accordion or tabs element isn't sticky, i.e. if it's just staying at the top and not following down, please see CSS: Debugging Position Sticky Not Working.
Cheers!
Can it be used on mobile phones? I tested it and it didn't show any results.
Greetings!
Did you try these instructions from the tutorial?
Open the HTML element, and you will see this near the start:
@media (min-width: 1025px) {
And lower down, you will see this in the JS:
if (window.innerWidth < 1025) return;
Adjust this 1025 value as you wish. For example, change it (in both places, keep the px present in the CSS) to 768 to have the code enabled on tablets and desktops. Change it to 0 to have it working everywhere.
Cheers!
Hi Maxime, I'm trying to import the first template but I only can see the containers and not the tabs, so the template results just with the hero and blank containers.
What I'm missing? Maybe I've to enable some contents in Elementor?
Greetings!
See this, very first part where it mention activating the feature.
https://elementor.com/help/tabs-with-nested-containers/
Cheers!
Hi, is there a way to make the last version horizontal? I want it to be a full screen part of the page where people horizontally scroll through.
Greetings Sander!
How would it be any different with horizontal scroll though? Everything is fixed on the page... nothing is scrolling anyway...
Let me know how you see this
Cheers!
Thanks for the reply. Horizontal scroll wasn't the right way to phrase it, i don't want a horizontal scrolllbar. I want the accordion items to be next to each other instead of on top of each other. So basically: Your example but rotated 270 degrees. Thanks for helping out!
Greetings Sander!
Alright I think I understand.
Try this solution: https://www.youtube.com/watch?v=9VvR3rA0908
Should still work fine with my custom code.
Cheers!
That is indeed what i was looking for. Unfortunately this method doesn't work well fullscreen. I'll find an alternative. Thanks for the help.