Skip to content
On this page

getScrollTop

Definition:

js
/**
 * @returns The distance from the top to the current position.
 * @description Get the distance from the top to the current position.
**/

Demo

Usage Example

ts
import { computed } from 'vue'
import { getScrollTop } from 'utils-snap-fn'

const fromTopValue = computed(() => {
  return getScrollTop()
})

Source Code

utils-snap-fn-docs