Skip to content

Commit 6431572

Browse files
authored
fix: the error width (#53)
1 parent c704ae9 commit 6431572

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/about/scroll-logos.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ function ScrollLogos() {
1111
const scrollContainer = scrollRef.current;
1212

1313
if (!scrollContainer) return;
14-
const totalWidth = scrollContainer.scrollWidth;
1514
let currentScrollPosition = 0;
1615

1716
const startScrolling = () => {
1817
const move = () => {
18+
const totalWidth = scrollContainer.scrollWidth;
19+
1920
currentScrollPosition += 1; // move 1px per interval
2021
if (currentScrollPosition >= totalWidth / 2) {
2122
currentScrollPosition = 0; // reset to 0 when it reaches the end

0 commit comments

Comments
 (0)