Results 1 to 4 of 4

Thread: Doctype

  1. #1

    Thread Starter
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090

    Doctype

    I'm trying to use:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    XHTML 1.0 transitional as my DOCTYPE on a page. Everything works fine, except for a 'Floating DIV' I have a DIV that stays at a certain location on the screen even after scrolling. Here's the function:

    Code:
    function doIt() {
    document.getElementById('sd').style.top = document.body.scrollTop + 50
    }
    and in the body tag I have onScroll="doIt()"

    Now, this script works if I remove the DOCTYPE bit, but I want to keep it, or at least have a DOCTYPE. Does anyone know of any DOCTYPE that supports this, or do you know how to get around this?
    Have I helped you? Please Rate my posts.

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Does the div have an id attribute or only a name attribute? It needs an id attribute.

    However that might not be it.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    it is a id
    I think it is the scrollTop bit. I don't think that actually exists in any proper versions of HTML.
    Have I helped you? Please Rate my posts.

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    It's a possibility. Not that it doesn't exist, but IE has differences in scripting when in standards (*cough*) mode. It might have a different value.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

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