使用toastr让我的FCM弹出窗口出现在屏幕上。通知是不同类型的(成功,信息等)-我如何定位我当前正在触发的特定元素?
这是我的代码:
// Handle incoming messages
messaging.onMessage(function(payload) {
console.log("Notification received: ", payload);
toastr["success"](payload.notification.body, payload.notification.title, {
"closeButton": true,
"debug": false,
"newestOnTop": false,
"progressBar": true,
"positionClass": "toast-top-left",
"preventDuplicates": false,
"showDuration": 30000,
"hideDuration": 1000,
"timeOut": 0,
"extendedTimeOut": 0,
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
});
});发布于 2019-01-23 12:09:10
我认为你想要生成最后一个吐司对吗?
如果吐司仍然存在于DOM中,则这将获得仍在屏幕上的最新生成的吐司
$('.toast').last();https://stackoverflow.com/questions/54076202
复制相似问题