How can I change sizes in pixels of a div and all its child elements?

Discussion in 'CSS' started by SoftLink, Jul 1, 2024.

  1. #1
    I'm trying to perform something like a zoom or scale function but I need to be able to retrieve the new top, left, width and height values in pixels.

    I tried scale and visually it transformed everything in the div but when I checked the computed styles they were unchanged.

    How can I scale a div and all it's child elements, then in javascript retrieve all the new position and dimension style values specifically in pixels?
     
    SoftLink, Jul 1, 2024 IP
  2. SoftLink

    SoftLink Active Member

    Messages:
    129
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    60
    #2
    I've got it: getBoundingClientRect works fine.
     
    SoftLink, Jul 1, 2024 IP