Skip to content

Commit

Permalink
背景音乐
Browse files Browse the repository at this point in the history
  • Loading branch information
caiyouhong committed Jan 20, 2017
1 parent bc98354 commit f92fe21
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 1 deletion.
Binary file added src/main/webapp/WEB-INF/lottery/images/music.mp3
Binary file not shown.
Binary file added src/main/webapp/WEB-INF/lottery/images/pause.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/webapp/WEB-INF/lottery/images/play.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 12 additions & 1 deletion src/main/webapp/WEB-INF/lottery/js/lottery.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,17 @@ $(document).ready(function () {
});
setInterval(function () {
getCnt();
}, 1000 * 5)
}, 1000 * 5);

var music = document.getElementById("music");
music.pause();
$("#audio_btn").click(function(){
if(music.paused){
music.play();
$("#music_btn").attr("src","images/pause.gif");
}else{
music.pause();
$("#music_btn").attr("src","images/play.gif");
}
});
});
12 changes: 12 additions & 0 deletions src/main/webapp/WEB-INF/lottery/js/lottery.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,16 @@ $(document).ready(function () {
setInterval(function () {
lottery.getCnt();
}, 1000 * 5)

var music = document.getElementById("music");
music.pause();
$("#audio_btn").click(function(){
if(music.paused){
music.play();
$("#music_btn").attr("src","images/pause.gif");
}else{
music.pause();
$("#music_btn").attr("src","images/play.gif");
}
});
});
4 changes: 4 additions & 0 deletions src/main/webapp/WEB-INF/lottery/lottery.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@
</script>
</head>
<body>
<div style="position:absolute;top:10px;right:10px;z-index:9999;">
<audio id="music" src="images/music.mp3" autoplay loop>你的浏览器不支持audio标签。</audio>
<a id="audio_btn"><img src="images/play.gif" width="48" height="50" id="music_btn" border="0"></a>
</div>
<div class="container">
<div class="top">
<div class="left">
Expand Down
4 changes: 4 additions & 0 deletions src/main/webapp/WEB-INF/lottery/lottery.new.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@
</style>
</head>
<body>
<div style="position:absolute;top:10px;right:10px;z-index:9999;">
<audio id="music" src="images/music.mp3" autoplay loop>你的浏览器不支持audio标签。</audio>
<a id="audio_btn"><img src="images/play.gif" width="48" height="50" id="music_btn" border="0"></a>
</div>
<div class="container">
<div class="top">
<div class="left">
Expand Down

0 comments on commit f92fe21

Please sign in to comment.