Jeg har prøvet at kigge lidt på relationerne mellem knapperne....prøv at se på dette :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"><html>
<head>
<title>Buttons panel - test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/javascript">
// Preload images
image01= new Image()
image01.src="buttons_panel.jpg"
image02= new Image() // play button
image02.src="picA_down.gif"
image03= new Image()
image03.src="picA_out.gif"
image04= new Image()
image04.src="picA_over.gif"
image05= new Image() // pause button
image05.src="picB_down.gif"
image06= new Image()
image06.src="picB_out.gif"
image07= new Image()
image07.src="picB_over.gif"
image08= new Image() // stop button
image08.src="picC_down.gif"
image09= new Image()
image09.src="picC_out.gif"
image10= new Image()
image10.src="picC_over.gif"
stat = new Array();
stat['picA']=true;
stat['picB']=false;
stat['picC']=true;
function butOver(oObject) {
if(oObject.src.indexOf("_out.gif")>0) {
oObject.src=oObject.src.substr(0, oObject.src.lastIndexOf("_"))+"_over.gif"; } }
function butOut(oObject) {
if(oObject.src.indexOf("_over.gif")>0) {
oObject.src=oObject.src.substr(0, oObject.src.lastIndexOf("_"))+"_out.gif"; } }
function butDown(oObject) {
if(stat[oObject.id]==true) {
if(oObject.src.indexOf("_over.gif")>0) {
oObject.src=oObject.src.substr(0, oObject.src.lastIndexOf("_"))+"_down.gif";
if(oObject.id=="picA") { stat['picB']=true; } }
else {
if(oObject.id=="picB") {
oObject.src=oObject.src.substr(0, oObject.src.lastIndexOf("_"))+"_over.gif"; } } } }
function butUp(oObject, oRel) {
if(oObject.src.indexOf("_down.gif")>0) {
oObject.src=oObject.src.substr(0, oObject.src.lastIndexOf("_"))+"_over.gif";
if(oObject.id=="picC") { stat['picB']=false; }
oArray=oRel.split(",");
for(t=0; t<oArray.length; t++) {
document.getElementById(oArray[t]).src=oArray[t]+"_out.gif"; }
} }
</script>
</head>
<body>
<div id="panelContainer" style="position:absolute; width:300px; height:50px; left:140px; top:140px; z-index:1;">
<div id="buttonsBack" style="position:absolute; width:300px; height:50px; left:0px; top:0px; z-index:2;"><img src="buttons_panel.jpg" width="300" height="50" alt="" border="0"></div>
<div id="buttonsContainer" style="position:absolute; width:180px; height:40px; left:30px; top:6px; z-index:3;">
<div id="playBtnContainer" style="cursor:pointer; position:absolute; width:54px; height:40px; left:00px; top:0px; z-index:4;"><img id="picA" style="width:54px; height:40px; border:0px;" onMouseDown="butDown(this);" onMouseUp="" onMouseOver="butOver(this);" onMouseOut="butOut(this);" src="picA_out.gif" alt="Start button" title="Start"></div>
<div id="pauseBtnContainer" style="cursor:pointer; position:absolute; width:54px; height:40px; left:61px; top:0px; z-index:5;"><img id="picB" style="width:54px; height:40px; border:0px;" onMouseDown="butDown(this);" onMouseUp="" onMouseOver="butOver(this);" onMouseOut="butOut(this);" src="picB_out.gif" alt="Pause button" title="Pause"></div>
<div id="stopBtnContainer" style="cursor:pointer; position:absolute; width:54px; height:40px; left:122px; top:0px; z-index:6;"><img id="picC" style="width:54px; height:40px; border:0px;" onMouseDown="butDown(this);" onMouseUp="butUp(this, 'picA,picB');" onMouseOver="butOver(this);" onMouseOut="butOut(this);" src="picC_out.gif" alt="Stop button" title="Stop"></div>
</div>
</div>
</body>
</html>
Mvh. Johan