Viewport
class Viewport
뷰포트 크기 정보를 담당하는 컴포넌트
constructor
new Viewport(el, el)
| PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
|---|---|---|---|---|
| el | Flicking | 뷰포트 엘리먼트 | ||
| el | HTMLElement |
Properties
element
readonly
뷰포트(root) 엘리먼트
Type: HTMLElement
width
readonly
뷰포트 너비
Type: number
height
readonly
뷰포트 높이
Type: number
padding
readonly
뷰포트 CSS padding 값
Type: object
| PROPERTY | TYPE | DESCRIPTION |
|---|---|---|
| left | number | CSS padding-left |
| right | number | CSS padding-right |
| top | number | CSS padding-top |
| bottom | number | CSS padding-bottom |
Methods
setSize
뷰포트 크기를 변경합니다..flicking-viewport 엘리먼트에 해당 크기의 CSS width/height를 적용합니다
| PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
|---|---|---|---|---|
| size | object | ✔️ | 새 뷰포트 크기 | |
| size.width | number | string | ✔️ | CSS 문자열 또는 숫자(px) | |
| size.height | number | string | ✔️ | CSS 문자열 또는 숫자(px) |
resize
현재 뷰포트 엘리먼트의 크기로 너비/높이를 업데이트합니다