3 Star 54 Fork 14

Yaohaixiao / dom.js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
isOverflowElement.js 608 Bytes
一键复制 编辑 原始数据 按行查看 历史
import isElement from './isElement'
import getStyles from './getStyles'
/**
* 判断 DOM 元素是否设置了 overflow 属性
* ========================================================================
* @method isOverflowElement
* @since 1.7.0
* @see https://github.com/floating-ui/floating-ui
* @param {HTMLElement} el
* @return {boolean}
*/
const isOverflowElement = (el) => {
if (!isElement(el)) {
return false
}
const { overflow, overflowX, overflowY } = getStyles(el)
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX)
}
export default isOverflowElement
JavaScript
1
https://gitee.com/yaohaixiao/dom.js.git
git@gitee.com:yaohaixiao/dom.js.git
yaohaixiao
dom.js
dom.js
main

搜索帮助

53164aa7 5694891 3bd8fe86 5694891