ElementHandle.isIntersectingViewport() 方法
如果元素在当前视口中可见,则解析为 true。如果元素是 SVG,则改为检查 svg所有者元素是否在视口中。参见 https://crbug.com/963246。
签名
class ElementHandle {
isIntersectingViewport(
this: ElementHandle<Element>,
options?: {
threshold?: number;
},
): Promise<boolean>;
}
参数
|
参数 |
类型 |
说明 |
|---|---|---|
|
this |
ElementHandle<Element> | |
|
options |
{ threshold?: number; } |
(可选) 相交阈值,介于 0(无相交)和 1(完全相交)之间。默认为 1。 |
返回值:
Promise<boolean>