The main method is to set a timer through the setTimeout method and switch the message prompt, so as to achieve the flashing of the title and message prompt.
JS effect-browser title bar flashing > timer: null,
// Display new message prompt
show: function () {
var title = message.title.replace("【 】", "").replace("【New message 】", "");
message.show( );
IF (MESSAGE.TIME % 2 == 0) {
Document.title = "New Message]" Title
}
Else {
Document.tital = "【 】" title
},
// Cancel new message reminder
clear : function () {
();
// Page Bind the click event when loading, click to cancel the flashing prompt
Click the page to cancel the message flashing prompt