Support Forum » CSS

hidden element's position

(4 posts)

  1. gt2304b
    Member

    kind of a strange request, but I was wondering if there was a way to access (via DOM or otherwise) the position properties of an element while it's still hidden...

    for example if I had a div element that has style: display: none -- is there a way that I could query the DOM and get the element's top and left position that it would have (if it were to be made visible later on with a display:block switch)?

    I know this is almost a javascript question, but thought I would try my luck on this support board, as I've gotten good solutions here. Thanks

    Posted: 2 years #
  2. JohnAllsopp
    Member

    I honestly don't know what position an element with display none has, or whether it would be consistent across browsers. Maybe try a little javascript to see what happens in different browsers (and whether static, relative and absolute are different)

    Interesting!

    john

    Posted: 2 years #
  3. gt2304b,

    Let the rest of us know if you a solution.

    Posted: 2 years #
  4. gt2304b
    Member

    short of making the element visible via display:block, grabbing it's position, and hiding it again right away, I haven't come up with a good way to do this.

    anyone else have any thoughts?

    Posted: 2 years #

RSS feed for this topic

Reply

You must log in to post.

0.071 - 9 queries