Hallo,
ich habe diesen Code:
<html>
<head>
<bgsound src="ssound.mp3" loop="0" autostart="false"></bgsound>
<script type="text/javascript">
function anzeigen ()
{
var a = document.getElementById("fenster");
var b = document.getElementById("link");
a.style.display = "block";
a.style.zIndex = 1;
b.style.zIndex = 0;
document.embeds[0].play();
document.bgsound[0].play();
}
function verstecken()
{
var a = document.getElementById("fenster");
a.style.display = "none";
document.embeds[0].stop();
document.bgsound[0].stop();
}
</script>
<style type="text/css">
#link{{width:420px; height:320px; position:absolute; display:block; background:yellow; border:2px solid red;}}
#fenster{width:420px; height:320px; margin:50px 0px 0px 100px; position:absolute; display:none; background:black; border:2px solid blue;}
</style>
</head>
<body>
<div id="link">
<input type="button" value="Anzeigen" onclick="anzeigen()"/> <input type="button" value="Verstecken" onclick="verstecken()"/>
</div>
<div id="fenster">
</div>
</body>
</html>
ich möchte wenn man auf "anzeigen" klickt, dass das DIV eingeblendet wird und das Hintergrundmusik gespiellt wird. Und wenn man auf "verstecken" klickt, soll das hintergrundmusik aufhören und das DIV soll halt nicht mehr zu sehen sein.
Naja, Ihr wisst ja, dass das objektorientiertes JS nicht so meine Stärke ist. Ich kann nur "stupides" JS.
Vielen Dank
Timur