Kunne være noget ala :
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0//EN' '
http://www.w3.org/TR/REC-html40/strict.dtd'><html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<title>Test</title>
<style type='text/css'>
.but
{
cursor: pointer;
border: 1px solid #D4D0C8;
}
</style>
<script type='text/javascript'>
function fnBut(oAction,oObject)
{
if(oObject.className!="but_disabled")
{
if(oAction=="1" || oAction=="4")
{
oObject.style.borderTopColor="#FFFFFF";
oObject.style.borderLeftColor="#FFFFFF";
oObject.style.borderRightColor="#000000";
oObject.style.borderBottomColor="#000000";
oObject.src=oObject.src.substr(0, oObject.src.lastIndexOf("_"))+"_on.jpg";
}
if(oAction=="2")
{
oObject.style.borderColor="#D4D0C8";
oObject.src=oObject.src.substr(0, oObject.src.lastIndexOf("_"))+"_on.jpg";
}
if(oAction=="3")
{
oObject.style.borderTopColor="#000000";
oObject.style.borderLeftColor="#000000";
oObject.style.borderRightColor="#FFFFFF";
oObject.style.borderBottomColor="#FFFFFF";
oObject.src=oObject.src.substr(0, oObject.src.lastIndexOf("_"))+"_act.jpg";
}
}
}
function fnBut1(oAction,oObject)
{
if(oObject.className=="but")
{
if(oAction=="1" && oObject.src.substr(oObject.src.lastIndexOf("_"))=="_on.jpg")
{
oObject.style.borderTopColor="#FFFFFF";
oObject.style.borderLeftColor="#FFFFFF";
oObject.style.borderRightColor="#000000";
oObject.style.borderBottomColor="#000000";
}
if(oAction=="2" && oObject.src.substr(oObject.src.lastIndexOf("_"))=="_on.jpg")
{
oObject.style.borderColor="#D4D0C8";
}
if(oAction=="3")
{
if(oObject.src.substr(oObject.src.lastIndexOf("_"))=="_on.jpg")
{
oObject.style.borderTopColor="#000000";
oObject.style.borderLeftColor="#000000";
oObject.style.borderRightColor="#FFFFFF";
oObject.style.borderBottomColor="#FFFFFF";
oObject.src=oObject.src.substr(0, oObject.src.lastIndexOf("_"))+"_act.jpg";
document.getElementById('vDel').value='on';
}
else
{
oObject.style.borderTopColor="#FFFFFF";
oObject.style.borderLeftColor="#FFFFFF";
oObject.style.borderRightColor="#000000";
oObject.style.borderBottomColor="#000000";
oObject.src=oObject.src.substr(0, oObject.src.lastIndexOf("_"))+"_on.jpg";
document.getElementById('vDel').value='off';
}
}
}
}
</script>
</head>
<body style='background-color: gray;'>
<form id='oForm' method='post' action='oLink.php' onsubmit="return false;">
<div style='position: relative; width: 100px; text-align: center; background-color: #D4D0C8;'>Knapper :<br>
<input type="image" class="but" src="but_del_on.jpg" name="Del" alt="Delete" onclick="act=this;" onmouseover="fnBut('1',this);" onmouseout="fnBut('2',this);" onmousedown="fnBut('3',this);" onmouseup="fnBut('4',this);">
<img class="but" src="but_del_on.jpg" id="Del" alt="Delete" onmouseover="fnBut1('1',this);" onmouseout="fnBut1('2',this);" onmousedown="fnBut1('3',this);">
<input type='hidden' id='vDel' value='off' name='hDel'>
</div>
</form>
</body>
</html>
Link til live version :
http://twobarrel.dk/eksperten/test.htmMvh. Johan