mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Add Video Rows
This commit is contained in:
parent
2342c01b7e
commit
3553923530
5 changed files with 182 additions and 21 deletions
13
helpers/scroll.js
Normal file
13
helpers/scroll.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
|
||||
function scrollHorizontalCarousel ( event ) {
|
||||
event.stopPropagation()
|
||||
|
||||
// console.log('event.target', event.currentTarget)
|
||||
// console.log('distance', event.currentTarget.getAttribute('distance'))
|
||||
|
||||
const distance = Number(event.currentTarget.getAttribute('distance'))
|
||||
const scrollTarget = document.querySelector(event.currentTarget.getAttribute('scroll-target'))
|
||||
|
||||
scrollTarget.scrollBy({ left: distance, behavior: 'smooth' })
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue