在这里它是托管的,所以你可以看到行为。(只有前两个键,最左边的白键和旁边的黑键)
http://23.23.184.26/miller/cssz/main.html
在chrome (19.-) 中完美工作 在 Firefox (12.0) 中产生蓝色光环 (选择?) 框在 IE9中根本不起作用
有什么建议吗?
<html>
<head>
<style type="text/css">
#main {
position:absolute;
left:0px;
top:0px;
z-index:100
}
#key1 {
position:absolute;
left:0px;
top:0px;
z-index:98
}
#key2 {
position:absolute;
left:0px;
top:0px;
z-index:98
}
#key1zone {
position:absolute;
width:50px;
height:75px;
top:175px;
left:55px;
z-index:200
}
#key2zone {
position:absolute;
width:50px;
height:75px;
top:100px;
left:85px;
z-index:200
}
/*uncomment this to show button zones*/
#key1zone:hover, #key2zone:hover {
border:1px solid red;
}
</style>
<script type="text/javascript">
function keyDown(key) {
document.getElementById(key).style.zIndex = "102";
}
</script>
<script type="text/javascript">
function keyUp(key) {
document.getElementById(key).style.zIndex = "98";
}
</script>
</head>
<body>
<div id="key1zone" onMouseDown="keyDown('key1')" onMouseUp="keyUp('key1')"
onMouseOut="keyUp('key1')"></div>
<div id="key2zone" onMouseDown="keyDown('key2')" onMouseUp="keyUp('key2')"
onMouseOut="keyUp('key2')"></div>
<img id="main" src="0.gif" width="506" height="319">
<img id="key1" src="1.gif" width="506" height="319">
<img id="key2" src="2.gif" width="506" height="319">
</body>
</html>