SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jan 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IE7 getting integer values for width:auto?

    I'm having quite the problem with IE7. I have to create a scrolling text box for a client. This scrolling text box moves <p> blocks inside a container, based on the width of the <p>, the left position of the <p> and the width of the container.

    However, I'm having a problem with IE7 because the <p> block has a width of auto. Now Firefox calculates the pixel dimensions of all elements and makes them accessible through the defaultView.getComputedStyle(); so it offers no problems. IE6 and its broken box model are fed a small integer ex width:200px; and it is stretched to fit the content. So it also is no trouble, as it just adjusts its small integer value to be larger.

    However, IE7 has fixed the broken box model that IE6 had, so I cannot pass it a CSS width:value, as it will render that value. However, when the property is set to auto, it doesn't make any integer value of the width available, any where that I can find. So does anyone know how I can determine the length of a box without having to declare its width?

  2. #2
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi markstory, Welcome to SPF!

    Try using "element.offsetWidth" and "element.offsetHeight".


Bookmarks

Posting Permissions

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