Der-Picknicker am 10.12.2005 11:28 schrieb:
Hi!
Mit welchen html befehlen mache ich ein bild (als link) das wenn die maus drauf is sich dass dann in ein enaderes umwandelt?
Das sind die 2 Bilder:
<div id="layerbild1" style="position: absolute; top:0; left:0; width:20; height:20; z-index:1">
<img src="[bild1adresse]" onmouseover="bildwechsel()" onmouseout="wechsel()">
</div>
<div id="layerbild2" style="position: absolute; top:0; left:0; width:20; height:20; z-index:1">
<img src="[bild2adresse]" onclick="fenster()">
Jetzt noch das Javascript in <head></head> einfügen:
<script>
function get() {
layerstyle1 = layerbild1.style
layerstyle2 = layerbild2.style
}
function bildwechsel() {
layerstyle1.visibility = "hidden"
layerstyle2.visibility = "visible"
}
function wechsel() {
layerstyle1.visibility = "visible"
layerstyle2.visibility = "hidden"
}
function fenster() {
window.open([Linkadresse])
}
</script>
der <body> tag muss folgendes enthalten:
onload="get()"