Class: IntersectionObserver

IntersectionObserver


new IntersectionObserver(initParams)

element 가 viewport 영역에 노출되는지 변화를 감지

Parameters:
Name Type Description
initParams Partial.<IIntersectionObserverExtOption>
Properties
Name Type Argument Default Description
target Element
visibleRatio Number <optional>
0
throttle Number <optional>
300
callback function | null <optional>
noop

callback function

options IntersectionObserverInit <optional>
{}
Source:
See:
Throws:

target 옵션을 지정하지 않은 경우 - throw new Error('IntersectionObserver target 설정은 필수 값 입니다.');

Type
Error
Example
.. TODO

Extends

Methods


<static> getIntersectionEntry(initParams)

element 가 이미 노출된 경우 등, IntersectionObserver 등록으로 판단이 어려울 경우
IntersectionObserver.getIntersectionEntry 를 이용하여 target 의 노출 여부를 판단

Parameters:
Name Type Description
initParams Partial.<IIntersectionObserverExtOption>
Properties
Name Type Argument Default Description
target Element
visibleRatio Number <optional>
0
throttle Number <optional>
300
callback function | null <optional>
noop

callback function

options IntersectionObserverInit <optional>
{}
Source:
Returns:
Type
IIntersectionChangeData
Example
.. TODO

attach()

이벤트 감지 설정

Source:
Returns:
Type
IntersectionObserver

destroy()

destroy

Source:
Returns:
Type
IntersectionObserver

detach()

이벤트 감지 해제

Source:
Returns:
Type
IntersectionObserver

emit(eventName, values)

이벤트 전파

Parameters:
Name Type Argument Description
eventName string
values Array.<any> <repeatable>
Inherited From:
Overrides:
Source:
Returns:
Type
EventEmitter

fire(eventName, values)

이벤트 전파

Parameters:
Name Type Description
eventName string
values any
Inherited From:
Overrides:
Source:
Returns:
Type
EventEmitter

off(eventName [, listener])

이벤트 감지 해제

Parameters:
Name Type Argument Description
eventName string
listener TypeVoidFunction <optional>
Inherited From:
Overrides:
Source:
Returns:
Type
EventEmitter

on(eventName [, listener] [, context])

이벤트 감지 등록

Parameters:
Name Type Argument Default Description
eventName string
listener TypeVoidFunction <optional>
noop
context * <optional>
Inherited From:
Overrides:
Source:
Returns:
Type
EventEmitter

once(eventName [, listener] [, context])

이벤트 1회 감지 등록

Parameters:
Name Type Argument Default Description
eventName string
listener TypeVoidFunction <optional>
noop
context * <optional>
Inherited From:
Overrides:
Source:
Returns:
Type
EventEmitter

Type Definitions


INTERSECTION_DIRECTIONS

Type:
  • String
Properties:
Name Type Description
UP String
DOWN String
UNKNOWN String
Source:

Events


INTERSECTION_EVENTS

IntersectionEvent Types

Properties:
Name Type Description
CHANGE String

변경 시점

Source: