Skip to content

Commit cea88c2

Browse files
author
Simon he
committed
chore: add getScrollPosition
1 parent 9957457 commit cea88c2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/getScrollPosition.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Position } from './types'
2+
export function getScrollPosition(el: Window = window): Position {
3+
return {
4+
x: el.scrollX,
5+
y: el.scrollY
6+
}
7+
}

0 commit comments

Comments
 (0)