DOCTYPE html PUBLIC and document.onmousemove

D

Defacta

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.
 
B

Beauregard T. Shagnasty

Defacta said:
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
 
D

Defacta

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

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 :)
 
B

Beauregard T. Shagnasty

Defacta said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top