scrollIntoView
- Syntax
- event.target.scrollIntoView()
- document.getElementById(‘demo’).scrollIntoView()
- Parameters
- scrollIntoView()
- scrollIntoView(alignToTop)
- true //align to the top of the visible area
- false //align to buttom of the visible area
- scrollIntoView(scrollIntoViewOptions)
- scrollIntoViewOptions
- bool/object
- {
behavior: “auto” | “instant” | “smooth”,
block: “start” | “end”,
} - {block: “start”} === false
- {block: “end”} === true
- scrollIntoViewOptions
近期评论