JS实现闪动的title消息提醒效果
https://www.jb51.net/article/51297.htm
flashTitle() {
if (this.notificationFlag || window.location.href.indexOf('chars') === -1) {
if (this.title_flag) {
this.title_flag = false
document.title = '【新订单】'
} else {
this.title_flag = true
document.title = '【 】'
}
} else {
document.title = 'title'// 窗口没有消息的时候默认的title内容
clearInterval(this.flash_title)
}
},
flash_titleIn() {
clearInterval(this.flash_title)
this.flash_title = setInterval(() => {
this.flashTitle()
}, 2000)
}
本文标题:JS实现闪动的title消息提醒效果
本文链接:https://www.haomeiwen.com/subject/iqtezctx.html
网友评论