Closed oliveirafilipe closed 6 years ago
Atualmente nas linhas 287 e 288 utiliza-se outerWidth e outerHeight, entretanto estes são funções de jQuery.
outerWidth
outerHeight
Baseado no site http://youmightnotneedjquery.com/ temos as seguintes soluções:
function outerHeight(el) { var height = el.offsetHeight; var style = getComputedStyle(el); height += parseInt(style.marginTop) + parseInt(style.marginBottom); return height; } outerHeight(el);
function outerWidth(el) { var width = el.offsetWidth; var style = getComputedStyle(el); width += parseInt(style.marginLeft) + parseInt(style.marginRight); return width; } outerWidth(el);
acho que vamos trabalhar com o clientRect que é mais estável e é baseado no que está visível. https://developer.mozilla.org/pt-BR/docs/Web/API/Element/getClientRects
clientRect
Atualmente nas linhas 287 e 288 utiliza-se
outerWidth
eouterHeight
, entretanto estes são funções de jQuery.Baseado no site http://youmightnotneedjquery.com/ temos as seguintes soluções: