Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • jQuery UI-Draggable
  • jQuery UI-Droppable
  • jQuery UI-Resizable
  • jQuery UI-Selectable
  • jQuery UI-Sortable
  • jQuery UI-Accordion
  • jQuery UI-Autocomplete
  • jQuery UI-Button
  • jQuery UI-Checkboxradio
  • jQuery UI-Controlgroup
  • jQuery UI-Datepicker
  • jQuery UI-Dialog
  • jQuery UI-Menu
  • jQuery UI-Progressbar
  • jQuery UI-Selectmenu
  • jQuery UI-Slider
  • jQuery UI-Spinner
  • jQuery UI-Tabs
  • jQuery UI-Tooltip
  • jQuery
  • Web Technology
Open In App
Next Article:
How to design calendar for web page using jQuery EasyUI ?
Next article icon

How to design menu on right click of webpage using jQuery EasyUI ?

Last Updated : 23 Jul, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

EasyUI is a HTML5 framework for using user interface components based on jQuery, React, Angular and, Vue technologies. It helps in building features for interactive web and mobile applications saving a lot of time for developers. It helps in building features for interactive web and mobile applications saving a lot of time for developers.

Download all the required pre-compiled files from the official website and save it in your working folder. Please take care of file paths during code implementation.

Official website for jQuery EasyUI:

https://www.jeasyui.com/download/index.php

Example 1: The following example demonstrates a simple menu display on the right click of the webpage. The script part also shows the event handling using the jQuery EasyUI framework.

HTML
<!DOCTYPE html> <html>  <head>     <meta charset="UTF-8">     <meta name="viewport" content="initial-scale=1.0,          maximum-scale=1.0, user-scalable=no">      <!-- EasyUI specific stylesheets-->     <link rel="stylesheet" type="text/css"          href="themes/metro/easyui.css">     <link rel="stylesheet" type="text/css"          href="demo.css">     <link rel="stylesheet" type="text/css"          href="themes/icon.css">      <!--jQuery library -->     <script type="text/javascript"          src="jquery.min.js">     </script>      <!--jQuery libraries of EasyUI  -->     <script type="text/javascript"          src="jquery.easyui.min.js">     </script> </head>  <body>     <h2>         jQuery EasyUI basic menu         on right click     </h2>      <p>         Please right click on         the webpage.     </p>      <!-- easyui-menu class is used  -->     <div id="menuID" style="width:120px;">         <div>New Window</div>         <div>             <span>Open</span>             <!-- menu-content class is used  -->             <div class="menu-content" style=                 "text-align:left;padding:10px">                  <div style="font-weight:bold;                     font-size:14px;margin-bottom:10px">                     Select Language:                 </div>                  <ul id="listID">                     <li>JavaScript</li>                     <li>Perl</li>                     <li>PHP</li>                     <li>Python</li>                 </ul>             </div>         </div>          <div data-options="iconCls:'icon-save'">             Save         </div>          <div class="menu-sep"></div>         <div>Exit</div>     </div>      <script>                  /* Event handling */         $(function () {             $('#menuID').menu();             $('#listID').tree();             $(document).bind('contextmenu', function (e) {                 e.preventDefault();                 $('#menuID').menu('show', {                     left: e.pageX,                     top: e.pageY                 });             });         });     </script> </body>  </html> 

Output: 

Example 2: The following example demonstrates a menu with its submenu using the above-mentioned framework.

HTML
<!DOCTYPE html> <html>  <head>     <meta charset="UTF-8">     <meta name="viewport" content="initial-scale=1.0,              maximum-scale=1.0, user-scalable=no">      <!-- EasyUI specific stylesheets-->     <link rel="stylesheet" type="text/css"          href="themes/metro/easyui.css">     <link rel="stylesheet" type="text/css"          href="demo.css">     <link rel="stylesheet" type="text/css"          href="themes/icon.css">      <!--jQuery library -->     <script type="text/javascript"          src="jquery.min.js">     </script>      <!--jQuery libraries of EasyUI  -->     <script type="text/javascript"          src="jquery.easyui.min.js">     </script> </head>  <body>     <h2>         jQuery EasyUI basic menu         on right click     </h2>      <p>         Please right click on         the webpage.     </p>       <!-- easyui-menu class is used  -->     <div id="menuID" class="easyui-menu"          style="width:120px;">          <div onclick="javascript:alert('new')">             New         </div>                  <div>             <span>Open</span>             <div style="width:150px;">                 <div><b>Interviews</b></div>                 <div>CS subjects</div>                 <div>Data Structures</div>                 <div>                     <span>Algorithms</span>                     <div style="width:120px;">                         <div>Bit algorithms</div>                         <div>Searching </div>                         <div>                             <span>Sorting</span>                             <div style="width:80px;">                                 <div onclick="javascript:                                     alert('Linear search')">                                     Linear search                                 </div>                                 <div>Binary search</div>                                 <div>Jump Search</div>                             </div>                         </div>                         <div>Backtracking</div>                     </div>                 </div>                  <div>                     <span>Window</span>                     <div style="width:120px;">                         <div>History</div>                         <div data-options= "href:'https://www.geeksforgeeks.org/python-programming-language/'">                             Bookmarks                         </div>                         <div>                             <a href=         "https://www.geeksforgeeks.org/" target="_blank">                                 GFG                             </a>                         </div>                     </div>                 </div>              </div>         </div>          <div data-options="iconCls:'icon-save'">             Save         </div>                  <!-- Set disabled to true if not want to enable -->         <div data-options="iconCls:'icon-print',disabled:true">             Print         </div>         <div class="menu-sep"></div>                  <!--menu-sep class is used for separator-->         <div>Exit</div>     </div>      <script>         $(function () {             $(document).bind('contextmenu', function (e) {                 e.preventDefault();                 $('#menuID').menu('show', {                     left: e.pageX,                     top: e.pageY                 });             });         });     </script> </body>  </html> 


Output:


Next Article
How to design calendar for web page using jQuery EasyUI ?

G

geetanjali16
Improve
Article Tags :
  • JavaScript
  • Web Technologies
  • HTML
  • CSS
  • JQuery
  • jQuery-UI
  • jQuery-Plugin

Similar Reads

  • How to design checkbox selection for webpage using jQuery EasyUI ?
    EasyUI is a HTML5 framework for using user interface components based on jQuery, React, Angular and Vue technologies. It helps in building features for interactive web and mobile applications saving a lot of time for developers. In this article, we will learn to design single and multiple select che
    3 min read
  • How to design complex layout for webpage using jQuery EasyUI ?
    EasyUI is a HTML5 framework for using user interface components based on jQuery, React, Angular and Vue technologies. It helps in building features for interactive web and mobile applications saving a lot of time for developers. In this article, we will learn to design the basic and complex layout f
    5 min read
  • How to design menu using jQuery EasyUI Mobile ?
    In this article, we will learn how to design menu list using jQuery EasyUI Mobile plugin. EasyUI is a HTML5 framework for using user interface components based on jQuery, React, Angular and Vue technologies. It helps in building features for interactive web and mobile applications saving a lot of ti
    2 min read
  • How to design calendar for web page using jQuery EasyUI ?
    EasyUI is a HTML5 framework for using user interface components based on jQuery, React, Angular and Vue technologies. It helps in building features for interactive web and mobile applications saving a lot of time for developers. In this article, we will learn how to design a calendar feature for our
    2 min read
  • How to design accordion using jQuery EasyUI Mobile ?
    EasyUI is a HTML5 framework for using user interface components based on jQuery, React, Angular and Vue technologies. It helps in building features for interactive web and mobile applications saving a lot of time for developers. Accordions are HTML contents that toggle between showing and hiding. Do
    3 min read
  • How to disable right-click option using the jQuery ?
    The bind() method in jQuery is used to attach one or more event handlers for selected element and this method specifies a function to run when an event occurs. Syntax: $(selector).bind(event, data, function);Parameters: This method accepts three parameters as mentioned above and described below: eve
    2 min read
  • How to design tabs and pills using jQuery EasyUI Mobile ?
    In this article, we will learn how to design tabs and pills using the jQuery EasyUI Mobile plugin.  Pills are basically the tabs that are in the form of dropdown menus. EasyUI is an HTML5 framework for using user interface components based on jQuery, React, Angular, and Vue technologies. It helps in
    5 min read
  • How to design combogrids using jQuery EasyUI ?
    EasyUI is a HTML5 framework for using user interface components based on jQuery, React, Angular and Vue technologies. It helps in building features for interactive web and mobile applications saving a lot of time for developers. In this article, we will learn how to design combogrids. Combogrids are
    3 min read
  • How to design login dialog using jQuery EasyUI Mobile ?
    EasyUI is a HTML5 framework for using user interface components based on jQuery, React, Angular and Vue technologies. It helps in building features for interactive web and mobile applications saving a lot of time for developers. In this article, we will learn to design login dialog and message dialo
    3 min read
  • How to design buttons for mobiles using jQuery EasyUI Mobile?
    EasyUI is an HTML5 framework for using user interface components based on jQuery, React, Angular, and Vue technologies. It helps in building features for interactive web and mobile applications saving a lot of time for developers. In this article, we will learn to design various button styles for th
    4 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences