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