3 Star 56 Fork 13

Yaohaixiao/dom.js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
hide.js 444 Bytes
一键复制 编辑 原始数据 按行查看 历史
import isElement from './isElement'
import getStyle from './getStyle'
import setStyle from './setStyle'
/**
* 隐藏指定 DOM 元素
* ========================================================================
* @method toggle
* @param {HTMLElement} el
*/
const hide = (el) => {
if (!isElement(el) || getStyle(el, 'display') === 'none') {
return false
}
setStyle(el, 'display', 'none')
}
export default hide
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/yaohaixiao/dom.js.git
git@gitee.com:yaohaixiao/dom.js.git
yaohaixiao
dom.js
dom.js
main

搜索帮助

Cb406eda 1850385 E526c682 1850385