I am want to create a react site where while scroll when I get to services section page should change from vertical scroll to horizontal scroll for that section. Any idea how can I achieve this?
Asked
Active
Viewed 1,000 times
0
-
1How to create a Minimal, Reproducible Example?? https://stackoverflow.com/help/minimal-reproducible-example – Maifee Ul Asad Mar 01 '22 at 11:03
-
This is a good question but you should show your code. – Arman Ebrahimi Mar 01 '22 at 11:04
2 Answers
1
You can use framer-motion: https://codesandbox.io/s/framer-motion-horizontal-scroll-by-scrolling-vertically-forked-473s1?file=/src/SmoothScroll.js
Framer-motion uses "ghost" div. Height of that div is equal to the slider length, you scroll it and framer create horizontal scrolling. It also check's when your slider is in a viewport.

Andrew Kruglik
- 182
- 1
- 11
0
How to get scrollbar position with Javascript?
this might help you if you got scroll position and add a condition on scroll

Jay
- 384
- 3
- 11
-
Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 01 '22 at 11:34