SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    \m/ R.I.P. Dimebag! \m/ JimBolla's Avatar
    Join Date
    Dec 2001
    Location
    erie, pa
    Posts
    1,130
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    determine canvas size in XHTML 1.0

    EDIT: OK. After more testing, I've come to the conclusion that under "standards-compliant mode" the canvas size is no longer accessed through window.document.body.offsetHeight in IE6. according to MS's documentation, its accessed through the html object but i cannot for the life of me figure out what the code i use to access it is. i've tried window.html, window.document.html, just html, and window.document.body.html and none of them seem to give me the object. someone help!




    i have a page that has:

    <div id="main" style="height: expression(eval(window.document.body.offsetHeight))">

    and this works as expected when the DOCTYPE is

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

    but when i change it to

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1-transitional.dtd">

    it not longer works in IE 6.0. Why does IE support expressions for HTML 4 but not for XHTML?


    EDIT: after some more testing, its not the dynamic expression thats not working, its the value of window.document.body.offsetHeight is always being returned as zero. why is this?
    Last edited by crowdozer; Mar 14, 2002 at 19:36.

  2. #2
    SitePoint Zealot t0m|ta's Avatar
    Join Date
    Mar 2002
    Location
    Madrid - Spain
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    may be...

    there is no height attribute for xtml elements ¿Can that be the answer?

    This may be a silly answer, but it just occurred me.

    bye

  3. #3
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am going to request that this get moved to the javascript forum. I think you may get many better response there.

    For my answer all I can say is I could never get that to work and I have never heard of the HTML element in the DOM.
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  4. #4
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Done!

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  5. #5
    SitePoint Enthusiast
    Join Date
    Jan 2002
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Its a document property, not a window property. Remove the window and it should work,

    window.document.body.offsetHeight to document.body.offsetHeight

    ---------

    However these values also account for the scrollbars:

    document.body.clientWidth;
    document.body.clientHeight;


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
  •