安静听雨2016
发表于 2019-12-20 23:13
分享老师的精彩佳贴,点赞
195400
发表于 2019-12-21 08:38
安静听雨2016 发表于 2019-12-20 23:13
分享老师的精彩佳贴,点赞
http://www.yinhuabbs.cn/data/attachment/forum/201912/20/123059ffon6y9p6tnedvne.gif
195400
发表于 2019-12-21 08:39
黔中一叟 发表于 2019-12-20 20:28
朋友,感谢你制作如此精美的音画与大家分享,与你网络相遇,是一种幸运,真诚地祝福:你在中画快乐、开心! ...
http://www.yinhuabbs.cn/data/attachment/forum/201912/20/123001hstspbnsskb1sb2s.gif
黔中一叟
发表于 2019-12-21 20:28
195400 发表于 2019-12-21 08:39
朋友不客气,天冷了,送你一句温馨的问候,传递的不只是温度;还有我的关心与祝福!
寒冬残荷
发表于 2021-6-4 13:55
欣赏!{:1_293:}{:1_293:}{:1_293:}学习(偷代码);P!
寒冬残荷
发表于 2021-6-4 14:00
<div style="position: relative" align=center>
<table border="0" cellspacing="0" cellpadding="0" align="center"> <tbody><tr><td>
<div style="width: 1000px; height:600px; overflow: hidden; position: relative" align="center">
<div id="播放背景音乐"></div>
</div>
</td></tr></tbody></table>
鼠标移进图片风播放音乐《叹情缘-祁隆》,移出则停止播放。仿楼主代码——练习。
</div>
<script type="text/javascript">
var bkmusic = function(bkmusic_para) {
var bkpichold = document.getElementById(bkmusic_para.holdId);
bkpichold.style.width = bkmusic_para.width;
bkpichold.style.height = bkmusic_para.height;
var imgEle = document.createElement('img');
imgEle.src = bkmusic_para.tp;
imgEle.style.width = bkmusic_para.width;
imgEle.style.height = bkmusic_para.height;
bkpichold.appendChild(imgEle);
var audioEle = document.createElement('audio');
audioEle.id = "audioEle";
audioEle.src = bkmusic_para.mp3url;
/*audioEle.autoplay = "true";*/
audioEle.loop = "true";
bkpichold.appendChild(audioEle);
if(typeof(bkmusic_para.movMouse)=='undefined') {
bkpichold.onclick = function(e) {
if(audioEle.paused) audioEle.play();
else audioEle.pause();
}
}
else {console.log(typeof(bkmusic_para.movMouse));
bkpichold.onmouseover = function(e) {
console.log("move in");
try {
if(audioEle.paused==true) audioEle.play();
}
catch(ev){}
}
bkpichold.onmouseout = function(e) {
try {
if(audioEle.paused==false) audioEle.pause();
}
catch(ev){}
}
}
}
var bkmusic_para = {
width:"1000px",
height:"600px",
tp:"http://www.yinhuabbs.cn/data/attachment/album/202106/04/100819qt777ckgnhg1klhz.jpg",
mp3url:"http://url.amp3a.com/kuwo.php/40086095.mp3",
holdId:"播放背景音乐",
movMouse:'1'
};
setTimeout(function(){bkmusic(bkmusic_para);}, 1000);
</script>