Scroll-snap to center projects in the view height
-
Hi everybody,
I want to use the scroll-snap in css to center my .row in the vh.
It is possible? I try but i seems there are too many div or css between the body and the .row.It works when i put the overlay:scroll; to the main-region but no intro and no footer...
Example: https://codepen.io/jdevaud/pen/ZNOKNo
Any ideas?
Thanks and have a nice week-end.
-
Dear @joackim
to integrate a scroll snap – you probably need to use Javascript. So first you need to have a look here:http://laytheme.com/documentation.html#custom-javascript
Best!
Marius
-
Hi Marius,
Thank you for your answer.
My codepen doesn't use any javascript... Normally, it can be done without js...Another idea?
Kind regards,
Joackim
-
Hmmm.
To my understanding Marius said you might need Javascript because you need to assign the scroll function to the respective containers. The CSS is fine but you may need Javascript to automatically assign your CSS classes.
I’m just guessing here.
-
Yes,
It might be a tricky one.
A snap function is not easy. To achieve it – I recommend to have a close look at least into jQuery.Best!
Marius
I don't answer or check forum DMs, please just post on the forum.
Before you post:
Use the Search Feature. Maybe there is already a solution to your issue.
1. Update Lay Theme and all Lay Theme Addons
2. Disable all Plugins
3. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code ", click "Save Changes"
4. Now see if your problem solved itself
5. Go here, see if your problem is listed here:
Troubleshooting
When you post:
1. Post a link to where the problem is
2. If the problem is difficult to explain, post screenshots / link to a video to explain it