Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

Navigation menu popup actions


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


Text formatting options
Submit

Replies (3)


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
});


Please assign kt_menu_notifications ID attribute to the notifications menu element with data-kt-menu="true" attribute.

Regards.

Regards.


Your Support Matters!

We will highly appreciate your Metronic Review on Themeforest.
Please go to Themeforest Downloads page, select Metronic & leave your feedback.

Hi,

Thanks. Your code helped me a lot.

Best Wishes,
Valentin



Hi happy,

Glad to hear that. Thank you for choosing Metronic.

Have a great day!

Regards.


Text formatting options
Submit
Text formatting options
Submit