Sha256: 3daf4cbd86b19674ac3598a1acaf8b8148e5a87a6453cd29681c72ce2984a0d9
Contents?: true
Size: 494 Bytes
Versions: 13
Compression:
Stored size: 494 Bytes
Contents
import { Controller } from "@hotwired/stimulus" export default class extends Controller { static targets = [ "content" ] next() { this.contentTarget.scrollTo({ left: this.#scrollLeft + this.#slideSize, behavior: "smooth" }) } previous() { this.contentTarget.scrollTo({ left: this.#scrollLeft - this.#slideSize, behavior: "smooth" }) } get #scrollLeft() { return this.contentTarget.scrollLeft } get #slideSize() { return this.contentTarget.clientWidth } }
Version data entries
13 entries across 13 versions & 1 rubygems