Autor | Zpráva | ||
---|---|---|---|
Albert Einstein Profil |
#1 · Zasláno: 3. 9. 2007, 11:17:51
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1250"> <style> span.menu { text-align:center; width:160px; height:30px; background-image:url('off.gif'); } </style> <script> function zmen() { this.style.backgroundImage='url(on.gif)'; } </script> <title></title> </head> <body> <span class="menu" onMouseOver="zmen()">neco</span> </body> </html> Jakto, že se po najeti myši na prvek, nezmění jeho pozadí?? |
||
habendorf Profil |
#2 · Zasláno: 3. 9. 2007, 11:24:18
Protože té funkci nepředáváš žádný parametr a ona neví, kde to má změnit.
|
||
Albert Einstein Profil |
#3 · Zasláno: 3. 9. 2007, 11:25:16
habendorf
Jak bych to měl změnit? |
||
habendorf Profil |
#4 · Zasláno: 3. 9. 2007, 11:30:51 · Upravil/a: habendorf
<span id="menu01" class="menu" onmouseover="zmen(this.id)">neco</span>
a function zmen(elementId) { document.getElementById(elementId).style.backgroundImage='url(on.gif)' ; } Vyzkoušej, píšu z hlavy, chyba je možná. |
||
Albert Einstein Profil |
#5 · Zasláno: 3. 9. 2007, 11:33:08
Bohužel nejde...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1250"> <style> span.menu { text-align:center; width:160px; height:30px; background-image:url('off.gif'); } </style> <script> function zmen(elementId) { document.getElemetById(elementId).style.backgroundImage='url(on.gif)'; } </script> <title></title> </head> <body> <span id="menu01" class="menu" onmouseover="zmen(this.id)">neco</span> </body> </html> |
||
habendorf Profil |
#6 · Zasláno: 3. 9. 2007, 11:34:24
Překlep Elemet -> Element
|
||
Albert Einstein Profil |
#7 · Zasláno: 3. 9. 2007, 11:36:34
habendorf
Teď už to jde! Dík |
||
Časová prodleva: 17 let
|
0