底部自适应漂浮代码
672 2020/11/8 02:53:54
在</body>内添加代码代码
<audio src="http://music.163.com/song/media/outer/url?id=1426649237.mp3" controls="controls" preload="none" id="music" hidden=""> </audio> <div onclick="a();" class="music"> <img src="http://www.cnx0.com/content/templates/fee/img/233.gif" width="60px" height="60px" id="d" onclick="c();" title="海底 一支榴莲"> </div>
function a(){ var audio = document.getElementById('music'); if(audio.paused){ audio.play(); } else{ audio.pause(); } } function c(){ var imgObj = document.getElementById("d"); var Flag=(imgObj.getAttribute("src",2)=="http://www.cnx0.com/content/templates/CNX/img/timg.gif") imgObj.src=Flag?"http://www.cnx0.com/content/templates/CNX/img/233.gif":"http://www.cnx0.com/content/templates/CNX/img/timg.gif"; }
.music { position: fixed!important; width: 60px; height: 65px; bottom: 43px; left: 34px; z-index: 9999; cursor: pointer; }
文章关键词:小人