1.0.14 • Published 5 years ago

dom-visible-observer v1.0.14

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

dom-visible-observer

在scroll过程中判断某个DOM是否已经进入指定容器的可视区域

npm install dom-visible-observer 

import visibleObserver from 'dom-visible-observer'

visibleObserver({
    container,
    el,
    threshold,
    show,
    hide
})

container

表示监听滚动的容器 默认是document

el

监听的DOM元素

threshold

差值 number 默认0

show

滚动容器时,当DOM进入容器可视区域时的回调

hide

滚动容器时,当DOM未进入或已离开容器可视区域时的回调

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago