jQuery context menu right click event with toggle function

In the following web there is a div and a menu at the bottom. 
When loading the document, using jQuery we hide the bottom menu with the hide() function.
We select the existing div with id "c_menu" and execute the event "contextmenu", that is to say, when we click with the right mouse button on the div, we create a function that executes the following:

  • Select the menu and apply css styles to it. With event.pageX and event.pageY sets the position of the selected element in relation to the left and top borders of the document.
  • It selects the menu and with toggle() it applies the state of showing or hiding the menu depending on whether it is visible at that moment.
Comments

PHP Captcha


Interesting Articles