Results 1 to 3 of 3

Thread: Ascertain width of newly injected DOM element

  1. #1

    Thread Starter
    Hyperactive Member Ms.Longstocking's Avatar
    Join Date
    Oct 2006
    Posts
    399

    Ascertain width of newly injected DOM element

    Losing it.

    On a mouseover event, I'm inserting a new DOM element that contains child elements.

    Based on the content that is injected, there are some positioning tweaks that need to take place.

    The problem:
    After the element is injected, I cannot get a calculated width. (I always get width:0)

    I CAN however, get the width of the new element AFTER the current function has finished executing. What I need is to be able to get the width of the new element before terminating the function that is fired on the mouseover event.

    Thoughts?

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: Ascertain width of newly injected DOM element

    tried element.offsetWidth? it's not part of the W3C specification, but it could get you what you want.

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Ascertain width of newly injected DOM element

    or getComputedStyle

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width