Function getScrollPercent

  • 获取滚动条百分比

    Parameters

    • direction: "X" | "Y" = 'Y'

      X/Y 轴的进度条

    • dom: any = document.documentElement

      元素

    Returns number

    getScrollPercent(document.documentElement, 'Y'); /// 0.581134549876