I recently started experimenting with angular 2 and I am trying to figure out how to create a menu that opens with multiple options on both mobile and desktop devices.
What I'm looking for is a way to trigger the opening of a menu when a long hold or right click occurs above the div
element with the class container
. The menu should look something like this -
https://i.sstatic.net/v21HJ.png
The HTML code snippet is shown below:
<div class="container" id="main-wrapper">
<section class="intro">
<div class="content">
<h1 [contentEditable]="contentEditable">You can create full-screen sections without JavaScript.</h1>
<p [contentEditable]="contentEditable">The height is set to 90vh, meaning 90% height.</p>
</div>
</section>
</div>
explore.ts
rightClickMenu() {
// Need guidance on what to implement in this function to achieve the desired menu.
}
Could you please provide advice on where and how to call this menu function?