- Registriert
- 29.11.05
- Beiträge
- 44
Hallo
Ich bin ganz neu dabei was JS anbelangt. Probiere gerade eine kleine Funktion für ein Menu zu basteln. Nichts wildes. Funktioniert jedoch nicht ganz wie ich mir es wünsche...
Hier der Quelltext:
HTML:
<img src="./layout/buttons/home.gif" onmouseover="chng('a')" onmouseout="chng2('a')">
<img src="./layout/buttons/home.gif" onmouseover="chng('b')" onmouseout="chng2('b')">
JS:
function chng(wert){
if (wert = "a"){
document.images("t1").src="./layout/buttons/pfeil.gif";
}
if (wert = "b"){
document.images("t2").src="./layout/buttons/pfeil.gif";
}
}
function chng2(){
if (wert = "a"){
document.images("t1").src="./layout/buttons/none.gif";
}
if (wert = "b"){
document.images("t2").src="./layout/buttons/none.gif";
}
}
Das soll nun ein pfeil einblenden...je nach button ... es blendet aber immer an beiden orten den pfeil ein. Wollte es eigentlich mit a / b beschränken und an die Funktion übergeben...scheint jedoch nicht zu funktionieren!
Bin für jede Hilfe dankbar!
Grüsse
Ich bin ganz neu dabei was JS anbelangt. Probiere gerade eine kleine Funktion für ein Menu zu basteln. Nichts wildes. Funktioniert jedoch nicht ganz wie ich mir es wünsche...
Hier der Quelltext:
HTML:
<img src="./layout/buttons/home.gif" onmouseover="chng('a')" onmouseout="chng2('a')">
<img src="./layout/buttons/home.gif" onmouseover="chng('b')" onmouseout="chng2('b')">
JS:
function chng(wert){
if (wert = "a"){
document.images("t1").src="./layout/buttons/pfeil.gif";
}
if (wert = "b"){
document.images("t2").src="./layout/buttons/pfeil.gif";
}
}
function chng2(){
if (wert = "a"){
document.images("t1").src="./layout/buttons/none.gif";
}
if (wert = "b"){
document.images("t2").src="./layout/buttons/none.gif";
}
}
Das soll nun ein pfeil einblenden...je nach button ... es blendet aber immer an beiden orten den pfeil ein. Wollte es eigentlich mit a / b beschränken und an die Funktion übergeben...scheint jedoch nicht zu funktionieren!
Bin für jede Hilfe dankbar!
Grüsse