MCPcopy
hub / github.com/layui/layui / getWidth

Function getWidth

src/modules/table.js:698–714  ·  view source on GitHub ↗
(parent)

Source from the content-addressed store, hash-verified

696 //获取容器宽度
697 //如果父元素宽度为0(一般为隐藏元素),则继续查找上层元素,直到找到真实宽度为止
698 var getWidth = function (parent) {
699 var width;
700 var isNone;
701 parent = parent || options.elem.parent();
702
703 width = that.getContentWidth(parent);
704
705 try {
706 isNone = parent.css('display') === 'none';
707 } catch (e) {
708 //
709 }
710 var parentElem = parent.parent();
711 if (parent[0] && parentElem && parentElem[0] && (!width || isNone))
712 return getWidth(parentElem);
713 return width;
714 };
715 return getWidth();
716 })();
717

Callers 1

table.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected