Hello

I need to add onclick event on a menu item button, when user click on the menu button i need to show a popup, how can i detect the onclick event in a menu item?????????'

Any ideas?

Comments

seancorrales’s picture

This is straightfoward JS/jQuery. You just need to identify the menu button with a class or ID. Then you can attach the onclick event. Should be something like this:

$('#elmentID').click(function(e){
   e.preventDefault();
   //Some code to show a popup goes here.
});
lucasvm’s picture

where should i need to add this code? in witch file?

seancorrales’s picture

You need to add it to a javascript file. Depending on the theme you're using, it can vary where this file will be located. Usually it's called "script.js" and it's located in the theme's folder.

The code isn't complete, though. You'll still need to write the code to show the popup.