“GetBoundingClientRect” Respostas de código

getBoundingClientRect () JavaScript

  var div = document.getElementById("myDiv");
  var rect = div.getBoundingClientRect();
  x = rect.left;
  y = rect.top;
  w = rect.width;
  h = rect.height;
Xenophobic Xenomorph

GetBoundingClientRect

// Return the size of an element and its position relative to the viewport:

const rect = obj.getBoundingClientRect();
console.log(rect)
Lioruby

Respostas semelhantes a “GetBoundingClientRect”

Procure respostas de código populares por idioma

Procurar outros idiomas de código