DOCTYPE html PUBLIC and document.onmousemove

Discussion in 'HTML' started by Defacta, Dec 18, 2007.

  1. Defacta

    Defacta Guest

    Hi !

    I try to make a message appears when the mouse is on an image et this
    is working fine:
    http://cult.free.fr/test_mouse_on/test_mouse.html

    But, if add the following line at the begining of the document, it's
    not working anymore with Firefox and whith Safari:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
    www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    The not working page is here:
    http://cult.free.fr/test_mouse_on/test_mouse2.html

    It's like these lines:

    document.getElementById("ghp_dpp").style.top = y + 30 ;
    document.getElementById("ghp_dpp").style.left = x + 30 ;

    is not executed anymore, does anyone know what I have to do to make
    this script work with the line of the <!DOCTYPE...>

    Thanks,
    Vincent.
     
    Defacta, Dec 18, 2007
    #1
    1. Advertising

  2. Defacta wrote:

    > I try to make a message appears when the mouse is on an image


    You can get rid of all that messy JavaScript by doing this:

    <img src="test_mouse_fichiers/menu_prefs.png" title="Voila encore du
    texte..." alt="Gear wheel" width="22" height="24">


    ...and use a Strict doctype:

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">

    Change from that 1990's style coding, too, then visit the Validators:
    http://validator.w3.org/
    http://jigsaw.w3.org/css-validator/validator.html

    --
    -bts
    -Motorcycles defy gravity; cars just suck
     
    Beauregard T. Shagnasty, Dec 18, 2007
    #2
    1. Advertising

  3. Defacta

    Defacta Guest

    On 18 déc, 16:11, "Beauregard T. Shagnasty"
    <> wrote:
    > Defacta wrote:
    > > I try to make a message appears when the mouse is on an image

    >
    > You can get rid of all that messy JavaScript by doing this:
    >
    > <img src="test_mouse_fichiers/menu_prefs.png" title="Voila encore du
    > texte..." alt="Gear wheel" width="22" height="24">
    >
    > ..and use a Strict doctype:
    >
    > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
    > "http://www.w3.org/TR/html4/strict.dtd">
    >
    > Change from that 1990's style coding, too, then visit the Validators:http://validator.w3.org/http://jigsaw.w3.org/css-validator/validator.html
    >
    > --
    > -bts
    > -Motorcycles defy gravity; cars just suck


    I have change the Javascript to specify the the "px":
    document.getElementById("ghp_dpp").style.top = (y + 30) + "px";
    document.getElementById("ghp_dpp").style.left = (x + 30) + "px";
    And it works fine now :)
     
    Defacta, Dec 18, 2007
    #3
  4. Defacta wrote:

    > And it works fine now :)


    ...for some degree of 'works' ... :-/

    Your choice of function names is appropriate: hide_mess()
    as it certainly is a mess - easily replaced with my example using the
    title attribute.

    --
    -bts
    -Motorcycles defy gravity; cars just suck
     
    Beauregard T. Shagnasty, Dec 18, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Charles A. Lackman
    Replies:
    1
    Views:
    1,379
    smith
    Dec 8, 2004
  2. SpamProof
    Replies:
    0
    Views:
    589
    SpamProof
    Oct 21, 2003
  3. Gary Mayor
    Replies:
    0
    Views:
    241
    Gary Mayor
    Mar 3, 2004
  4. Gary Mayor
    Replies:
    3
    Views:
    277
    Rob Swindells
    Mar 4, 2004
  5. Defacta
    Replies:
    1
    Views:
    129
    Martin Honnen
    Dec 18, 2007
Loading...

Share This Page