Advertisement
DeaD_EyE

getClientsRects

Dec 31st, 2021
1,002
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. imgs = document.getElementsByTagName("img");
  2.  
  3. for (idx in imgs) {
  4.   // console.log(imgs[idx]);
  5.   element = imgs[idx];
  6.   try {
  7.     coords = element.getClientRects()[0];
  8.     // console.log(coords);
  9.     value = coords.x + coords.y + coords.width + coords.height + coords.left + coords.right;
  10.    
  11.     console.log(value);
  12.   } catch (e) {
  13.     // console.log(e);
  14.   }
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement