How to add a custom right-click menu to a webpage?

后端 未结 19 1508
广开言路
广开言路 2020-11-22 15:54

I want to add a custom right-click menu to my web application. Can this be done without using any pre-built libraries? If so, how to display a simple custom right-click menu

19条回答
  •  孤独总比滥情好
    2020-11-22 16:17

    Pure JS and css solution for a truly dynamic right click context menu, albeit based on predefined naming conventions for the elements id, links etc. jsfiddle and the code you could copy paste into a single static html page :

    
    
    
      
    
    
    
    
      
      right click link-01
      right click link-02
    
      
      
      
    
      
    
    
    

提交回复
热议问题