onmouseover
Christoph
- javascript
0 MichelM
Hi,
ich hab leichte Probleme mit meinem Rollover Effekt...
Wie gewöhnlich tausche ich bei onMouseOver die jeweilige Grafik aus
und bei onMouseOut auch um den "Normalzustand" wieder zu bekommen...
Soweit klappt alles wunderbar, allerdings ist der Rollover Effekt im IE ziehmlich langsam und unrealistisch, im Mozilla und Netscape klappt es alles wunderbar flüssig...
Ich nehme an das der IE die Grafiken nicht in den Cache Lädt!?!
Kann mir da jemand Rat geben?
Danke für eure Hilfe...
MfG Chris
Zur Verdäutlichung:
hlight_off = new Image();
hlight_off.src = "img/t_hlight_off.gif";
hlight_on = new Image();
hlight_on.src = "img/t_hlight_on.gif";
austauschen tu ich die Grafiken:
onMouseOver
onMouseOut
Hallo,
Probleme mit dem Cache tauchen öfters auf.
Allerdings scheint das Problem auch an der Art der Adressierung zu liegen, die für das Caching relativ sein muss:
hlight_on.src = "./img/t_hlight_on.gif";
Eine andere Lösung ist die, Layer zu wechseln, z.B. mit
function wechel(layerid,ebene){
if (document.getElementById&&!document.all)
{
if(ebene==1){
document.getElementById(layerid+1).style.zIndex=5;
document.getElementById(layerid+2).style.zIndex=1;
document.getElementById(layerid+3).style.zIndex=1;
}
else if(ebene==2){
document.getElementById(layerid+1).style.zIndex=1;
document.getElementById(layerid+2).style.zIndex=5;
document.getElementById(layerid+3).style.zIndex=1;
}else
document.getElementById(layerid+1).style.zIndex=1;
document.getElementById(layerid+2).style.zIndex=1;
document.getElementById(layerid+3).style.zIndex=5;
}
}
else{
if(ebene==1){
document.all(layerid+1).style.zIndex=5;
document.all(layerid+2).style.zIndex=1;
document.all(layerid+3).style.zIndex=1;
}
else if(ebene==2){
document.all(layerid+1).style.zIndex=1;
document.all(layerid+2).style.zIndex=5;
document.all(layerid+3).style.zIndex=1;
}else
document.all(layerid+1).style.zIndex=1;
document.alllayerid+2).style.zIndex=1;
document.all(layerid+3).style.zIndex=5;
}
}
<DIV id="ebene1" onmouseover=wechsel("ebene",1) onmouseout=wechsel("ebene",2) onclick=wechsel("ebene",3)>hier Bild und Link für onmouseover</DIV>
<DIV id="ebene2" onmouseover=wechsel("ebene",1) onmouseout=wechsel("ebene",2) onclick=wechsel("ebene",3)>hier Bild und Link für onmouseout</DIV>
<DIV id="ebene3" onmouseover=wechsel("ebene",1) onmouseout=wechsel("ebene",2) onclick=wechsel("ebene",3)>hier Bild und Link für onclick</DIV>
Michael