Hi,
I'm using Metronic 8.1.7 theme, demo1. I want to implement notification pop-up window or drop-down like Notifications in Header in demo1. Notifications are now loaded from database on web application start.
I want to catch event of notifications window showing, load notifications from db and check/update for logged user to db that all unread notifications are read.
I tryed jquery version of "on show" and "on hover" on various elements of menu, but nothing works.
Any idea?
Best regards,
Valentin
Hi,
The header notification dropdown menus use Metronic's KTMenu component and you can use its API to capture show events:
var menuElement = document.querySelector("#kt_menu_notifications");
var menu = KTMenu.getInstance(menuElement);
menu.on("kt.menu.dropdown.show", function(item) {
// handle before show
});
menu.on("kt.menu.dropdown.shown", function(item) {
// handle after shown
});
kt_menu_notifications
ID attribute to the notifications menu element with data-kt-menu="true"
attribute.Hi,
Thanks. Your code helped me a lot.
Best Wishes,
Valentin
Hi ,
Glad to hear that. Thank you for choosing Metronic.
Have a great day!
Regards.