Skip to content

Commit

Permalink
notice opacity
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Aug 19, 2017
1 parent 644e473 commit 6bf1975
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dist/DPlayer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/DPlayer.min.js.map

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions src/DPlayer.js
Expand Up @@ -1112,19 +1112,16 @@ class DPlayer {
};
}

notice (text, time) {
notice (text, time = 2000, opacity = 0.8) {
const noticeEle = this.element.getElementsByClassName('dplayer-notice')[0];
noticeEle.innerHTML = text;
noticeEle.style.opacity = 1;
noticeEle.style.opacity = opacity;
if (this.noticeTime) {
clearTimeout(this.noticeTime);
}
if (time && time < 0) {
return;
}
this.noticeTime = setTimeout(() => {
noticeEle.style.opacity = 0;
}, time || 2000);
}, time);
}

destroy () {
Expand Down

0 comments on commit 6bf1975

Please sign in to comment.