JS实现按钮添加背景音乐示例代码
时间:2022-08-01 10:47:47|栏目:JavaScript代码|点击: 次
1-代码
<html>
<head>
<meta charset="utf-8">
<title>js实现按键声</title>
</head>
<body>
<ul>
<li>
<a href="menu-list" rel="external nofollow" rel="external nofollow" rel="external nofollow" >主页</a>
</li>
<li>
<a href="menu-list" rel="external nofollow" rel="external nofollow" rel="external nofollow" >详情</a>
</li>
<li>
<a href="menu-list" rel="external nofollow" rel="external nofollow" rel="external nofollow" >列表</a>
</li>
</ul>
<script language="javascript">
$(function() {
$('menu-list').click(function() {
$('btn-bgm').remove();
$('body').append('<embed src="button.wav" autostart="true" hidden="true" loop="false" class = "btn-bgm">');
});
});
</script>
</body>
</html>
2-描述
事先给节点绑定事件,点击后出发添加背景音乐
总结
上一篇:微信小程序template模板与component组件的区别和使用详解
栏 目:JavaScript代码
下一篇:JavaScript中本地存储(LocalStorage)和会话存储(SessionStorage)的使用
本文标题:JS实现按钮添加背景音乐示例代码
本文地址:http://www.codeinn.net/misctech/209538.html






