Creating Infinite Horizontal Scrolling with Pause on Hover in Webflow
Implement the 'Infinite Horizontal Scrolling with Pause on Hover' feature in Webflow using custom CSS code.
Access the template here.
Ensure the element structure is as follows:
Utilize the Webflow Designer to configure the CSS Variables.
- Set
overflow: hidden
andwidth: 100vw
on the Section element. - Set the Wrapper element to
display: flex
andjustify-content: flex-start
. - Set the List element to
flex-shrink: 0
. Adjust the layout as per your requirement.
Implement the infinite horizontal scrolling feature in Webflow by adding the following custom CSS code before the body tag or before the section element:
html<style> .list { will-change: transform; animation: list-horizontal-scroll 20s linear infinite; } @keyframes list-horizontal-scroll { from { transform: translateX(0); } to { transform: translateX(calc(-100% - 32px)); } } .wrapper:hover .list { animation-play-state: paused; } </style>
html<style> .list { will-change: transform; animation: list-horizontal-scroll 20s linear infinite; } @keyframes list-horizontal-scroll { from { transform: translateX(0); } to { transform: translateX(calc(-100% - 32px)); } } .wrapper:hover .list { animation-play-state: paused; } </style>
Adjust the class names list, list-horizontal-scroll, and wrapper as per your requirement.
Adjust the value 32px
in transform: translateX(calc(-100% - 32px));
to match the gap size of your list.
If your list element is too short to fill the screen, duplicate it multiple times to fill the screen.