MCPcopy Create free account
hub / github.com/ThatGuySam/doesitarm / scrollHorizontalCarousel

Function scrollHorizontalCarousel

helpers/scroll.js:3–13  ·  view source on GitHub ↗
( event )

Source from the content-addressed store, hash-verified

1
2
3export function scrollHorizontalCarousel ( event ) {
4 event.stopPropagation()
5
6 // console.log('event.target', event.currentTarget)
7 // console.log('distance', event.currentTarget.getAttribute('distance'))
8
9 const distance = Number(event.currentTarget.getAttribute('distance'))
10 const scrollTarget = document.querySelector(event.currentTarget.getAttribute('scroll-target'))
11
12 scrollTarget.scrollBy({ left: distance, behavior: 'smooth' })
13}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected