Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript just a confirmation about the flow of the elements

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #34561
    plx
    Member

    Hello everybody,

    if you want a div to expand itself and have as the same dimension as the its absolutely positioned children,
    the only way is to calculate the area of the container by extracting offsetwidth + offsetleft and offsetheight + offsetleft of the contained children.

    Is it true ?

    Example:


    item01

    item02

    Is it possible to have div#container’s offsetWidth and offsetHeight (120 and 70 px) automatically calculated by the browser ?

    Thanks for your help.
    Regards, plx.

    #88262
    plx
    Member

    Thanks for your answer. I wish there was a trick.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.