JavaScript 鼠标划过 播放音乐。

时间:2021-10-03 15:07:00
'<EMBED style="FILTER: xray()" src="mp3/'+s+'" width=360 height=30 type=audio/mpeg volume="0" loop="-1">'
//EMBED : 镶入式 | FILTER: 滤波器 | volume:音量 | loop :循环
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>音乐之家</title>
<style type="text/css">
<!--
#box {
height: 650px;
width: 600px;
margin-top: 10px;
margin-right: auto;
margin-left: auto;
}
.mi {
margin: 5px;
float: left;
height: 110px;
width: 110px;
}
a {
height: 110px;
width: 100%;
display: block;
}
body {
background-image: url(bg1.jpg);
background-attachment: scroll;
background-repeat: no-repeat;
background-position: center top;
}
#m1 {
background-image: url(mi/1.jpg);
}
#m2 {
background-image: url(mi/2.jpg);
}
#m3 {
background-image: url(mi/3.jpg);
}
#m4 {
background-image: url(mi/4.jpg);
}
#m5 {
background-image: url(mi/5.jpg);
}
#m6 {
background-image: url(mi/6.jpg);
}
#m7 {
background-image: url(mi/7.jpg);
}
#m8 {
background-image: url(mi/8.jpg);
}
#m9 {
background-image: url(mi/9.jpg);
}
#m10 {
background-image: url(mi/10.jpg);
}
#m11 {
background-image: url(mi/11.jpg);
}
#m12 {
background-image: url(mi/12.jpg);
}
#m13 {
background-image: url(mi/13.jpg);
}
#m14 {
background-image: url(mi/14.jpg);
}
#m15 {
background-image: url(mi/15.jpg);
}
#m16 {
background-image: url(mi/16.jpg);
}
#m17 {
background-image: url(mi/17.jpg);
}
#m18 {
background-image: url(mi/18.jpg);
}
#m19 {
background-image: url(mi/19.jpg);
}
#m20 {
background-image: url(mi/20.jpg);
}
-->
</style>
</head>
<script src="jquery.rotate.min.js"></script>
<script language="javascript">
function play(s){ var m = '<EMBED style="FILTER: xray()" src="mp3/'+s+'" width=360 height=30 type=audio/mpeg volume="0" loop="-1">'
$("#msg").html(m)
}
function stop1(){ $("#msg").html("")
} </script>
<body>
<div id="box">
<div id="m1" class="mi"><a href="#" onclick="" onmouseover="play('a1.mp3')" onmouseout="stop1()" ></a></div>
<div id="m2" class="mi"><a href="#" onclick="" onmouseover="play('a2.mp3')" onmouseout="stop1()" ></a></div>
<div id="m3" class="mi"><a href="#" onclick="" onmouseover="play('a3.mp3')" onmouseout="stop1()" ></a></div>
<div id="m4" class="mi"><a href="#" onclick="" onmouseover="play('a4.mp3')" onmouseout="stop1()" ></a></div>
<div id="m5" class="mi"><a href="#" onclick="" onmouseover="play('a5.mp3')" onmouseout="stop1()" ></a></div>
<div id="m6" class="mi"><a href="#" onclick="" onmouseover="play('a6.mp3')" onmouseout="stop1()" ></a></div>
<div id="m7" class="mi"><a href="#" onclick="" onmouseover="play('a7.mp3')" onmouseout="stop1()" ></a></div>
<div id="m8" class="mi"><a href="#" onclick="" onmouseover="play('a8.mp3')" onmouseout="stop1()" ></a></div>
<div id="m9" class="mi"><a href="#" onclick="" onmouseover="play('a9.mp3')" onmouseout="stop1()" ></a></div>
<div id="m10" class="mi"><a href="#" onclick="" onmouseover="play('a10.mp3')" onmouseout="stop1()" ></a></div>
<div id="m11" class="mi"><a href="#" onclick="" onmouseover="play('a11.mp3')" onmouseout="stop1()" ></a></div>
<div id="m12" class="mi"><a href="#" onclick="" onmouseover="play('a12mp3')" onmouseout="stop1()" ></a></div>
<div id="m13" class="mi"><a href="#" onclick="" onmouseover="play('a13.mp3')" onmouseout="stop1()" ></a></div>
<div id="m14" class="mi"><a href="#" onclick="" onmouseover="play('a14.mp3')" onmouseout="stop1()" ></a></div>
<div id="m15" class="mi"><a href="#" onclick="" onmouseover="play('a15.mp3')" onmouseout="stop1()" ></a></div>
<div id="m16" class="mi"><a href="#" onclick="" onmouseover="play('a16.mp3')" onmouseout="stop1()" ></a></div>
<div id="m17" class="mi"><a href="#" onclick="" onmouseover="play('a17.mp3')" onmouseout="stop1()" ></a></div>
<div id="m18" class="mi"><a href="#" onclick="" onmouseover="play('a18.mp3')" onmouseout="stop1()" ></a></div>
<div id="m19" class="mi"><a href="#" onclick="" onmouseover="play('a19.mp3')" onmouseout="stop1()" ></a></div>
<div id="m20" class="mi"><a href="#" onclick="" onmouseover="play('a20.mp3')" onmouseout="stop1()" ></a></div>
</div>
<div id="msg"></div> </body>
</html>