js 网页右下角弹出消息框




// // 弹出框显示函数
// function showPopup() {
//     $('#popupContainer').fadeIn();
//     notificationAudio.play();
//     autoCloseTimer = setTimeout(closePopup, 3000); // 3秒后自动关闭
// }
//
// // 弹出框关闭函数
// function closePopup() {
//     $('#popupContainer').fadeOut();
//     notificationAudio.pause(); // 暂停音乐播放
//     notificationAudio.currentTime = 0; // 重置音乐播放时间
//     clearTimeout(autoCloseTimer); // 清除自动关闭定时器
// }
//
//
// // 鼠标悬停事件
// $('#popupContainer').hover(function() {
//     clearTimeout(autoCloseTimer); // 鼠标悬停时清除自动关闭定时器
// }, function() {
//     autoCloseTimer = setTimeout(closePopup, 3000); // 鼠标离开时重新设置自动关闭定时器
// });
//
// // 5秒后自动弹出框(模拟收到新消息)
// function checkNewMessage() {
//     console.log(22)
//     // 发送请求到后台接口检查是否有新消息
//     // 这里假设后台返回一个布尔值来表示是否有新消息
//     var hasNewMessage = false; // 这里假设没有新消息
//     if (hasNewMessage) {
//         showPopup("你收到新的消息 点击查看");
//     }
// }
//
// // 每隔一分钟检查一次是否有新消息
// setInterval(checkNewMessage, 3000);
//
// // 点击“点击查看”链接时的事件处理
// $('#viewMessage').click(function(event) {
//     event.preventDefault(); // 阻止默认链接行为
//     // 这里可以添加点击链接后的处理逻辑
//     closePopup(); // 关闭弹窗
// });
//
// // 点击“关闭”链接时的事件处理
// $('#closePopup').click(function(event) {
//     event.preventDefault(); // 阻止默认链接行为
//     closePopup(); // 关闭弹窗
// });

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值