Contextmenu using Jquery
How do I make an contextmenu using jquery?
This pen having a custom context menu, when user click on body of webpage custom context menu display in place of system default context menu.. What is a contextmenu using jquery? How do you make a contextmenu using jquery? This script and codes were developed by Parth Viroja on 03 September 2022, Saturday.
Contextmenu using Jquery - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Contextmenu using Jquery</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <body oncontextmenu="return false"> <h1>Context Menu using Jquery</h1> <h2>click right click to view custom contextmenu.</h2> <div id="main-menu" class="select-div"> <ul> <li>Mainland China 简体中文</li> <li>Hong Kong 繁體中文</li> <li>Taiwan 繁體中文</li> <li>Global Home</li> </ul> </div>
</body> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Contextmenu using Jquery - Script Codes CSS Codes
*,
*::before,
*::after { padding: 0px; margin: 0px; text-decoration: none; list-style-type: none; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; -o-box-sizing: border-box; -box-sizing: border-box;
}
html,
body { height: 100%;
}
body { background-color: #069; color: #fff; font-family: "Calibri"; font-size: 1em; font-weight: lighter; overflow: hidden; overflow-y: auto; background-image: url('https://github.com/images/modules/home/octicons-bg.png');
}
h1,
h2 { font-weight: lighter;
}
h1 { font-weight: 100; display: block; font-size: 2em; margin: 20px auto; text-align: center;
}
h2 { font-weight: 100; display: block; font-size: 1.6em; margin: 20px auto; text-align: center; color: rgba(255, 255, 255, 0.6);
}
.select-div { position: absolute; margin: 20px auto; width: 200px; top: 0px; left: 0px; background-color: rgba(0, 0, 0, 0.2); border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 4px; overflow: hidden; z-index: 111111111; display: none;
}
.select-div > ul { display: block; border-radius: 4px; overflow: hidden;
}
.select-div > ul > li { line-height: 36px; padding: 2px 10px;
}
.select-div > ul > li:hover { background-color: rgba(0, 0, 0, 0.2);
}
Contextmenu using Jquery - Script Codes JS Codes
var cursorX = 0, cursorY = 0;
$(document).on('contextmenu', function(e) { $('#main-menu').css({ top: (cursorY - 24), left: (cursorX - 4), display: 'block' }); $('#main-menu').on('mouseleave', function() { $(this).hide(); });
});
$(window).on('mousemove', function(e) { cursorX = (window.Event) ? e.pageX : event.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft); cursorY = (window.Event) ? e.pageY : event.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
});
Developer | Parth Viroja |
Username | parthviroja |
Uploaded | September 03, 2022 |
Rating | 3 |
Size | 2,526 Kb |
Views | 32,384 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
MY CV | 4,057 Kb |
Ripple Effect | 2,548 Kb |
Box transition | 1,784 Kb |
Responsive grid with filter, sort and layout | 2,993 Kb |
Rotate Circle Pure Javascript | 2,896 Kb |
Card border collspan | 1,781 Kb |
Jquery Tab | 2,367 Kb |
Upload Image Form | 2,689 Kb |
Text Shapes | 1,928 Kb |
Ubuntu Terminal | 2,603 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
SVG Basics | HipsterBrown | 1,852 Kb |
Rainbow Drops | Csbarnes | 2,365 Kb |
Intake Form Page 2 | Ijantje | 4,983 Kb |
Pure CSS albums gallery | Renaudtertrais | 2,978 Kb |
Free css icon set v2 - one div | Ben_jammin | 0 Kb |
IE11 Test | Boostnewmedia | 4,998 Kb |
Out of the blue | Giaco | 2,537 Kb |
Parallax.js | Zmeeey5 | 2,330 Kb |
A Pen by Bryan | Brydave | 2,286 Kb |
OnScreenAction | Ozgursagiroglu | 2,647 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!