我目前正在尝试使我的 Tumblr 页面尽可能好,并将其与其他页面区分开来。有一个带有菜单项的侧边栏,当用户将鼠标悬停在它们上方时,这些菜单项会突出显示并略微向左移动。但是,我还想在触发 :hover 时播放声音。
这是侧边栏菜单代码。
#sidebar{
margin-left:85px;
margin-top:50px;
{block:IfNotStaticSidebar}position:absolute;{block:IfNotStaticSidebar}
{block:IfStaticSidebar}position:fixed;{/block:IfStaticSidebar}
background-color:{color:Sidebar};
width:200px;
padding:10px;
text-align:justify;
-moz-border-radius: 0px 50px 0px 0px;
-webkit-border-radius: 0px 50px 0px 0px;
-o-border-radius: 0px 50px 0px 0px;
border-radius: 0px 50px 0px 0px;
}
#description{
width:90%;
margin:10px;
}
a.block {
display:inline;
text-align: left;
font-size:10pt;
padding:3px;
margin:5px;
position:relative;
background-color:{color:color4};
display: inline-block;
font-family : arial;
color: {color:Menu Links Font};
font-weight: bold;
width: 100px;
transform: rotate(0deg);
-moz-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
-o-transform: rotate(0deg);
-webkit-transition: all .5s ease;
-moz-transition: all .5s ease;
-o-transition: all .5s ease;
}
a.block:hover {
color: {color:Menu Links Font Hover};
background-color:{color:color5};
padding-left:20px;
-webkit-transition: all .5s ease;
-moz-transition: all .5s ease;
-o-transition: all .5s ease;
text-shadow:0px 0px 5px {color:Shadow};
}
这是我正在尝试调整的声音代码。
<script language="javascript" type="text/javascript">
function playSoun
d(soundfile) {
document.getElementById("dummy").innerHTML=
"<embed src=\""+soundfile+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" />";
}
</script>
<span id="dummy"></span>
<p onmouseover="playSound('http://www.freesound.org/data/previews/141/141259_2555977-lq.mp3');"> Hover over this text </p>
我将不胜感激任何帮助!