Right Click Menu

2,252 Kb

How do I make an right click menu?

What is a right click menu? How do you make a right click menu? This script and codes were developed by Alexander Nastase on 21 August 2022, Sunday.

Right Click Menu Previews

Right Click Menu - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Right Click Menu</title> <script src="http://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="css/style.css">
<body> <h1>Right Click Somewhere</h1>
<ul id="context"> <li><span>Undo</span></li>
<li><span>Paste as Plain Text</span></li>
<li><span>Inspect Element</span></li>
</ul> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>

Right Click Menu - Script Codes CSS Codes

body { background-color: #ccc; overflow: hidden; font-family:arial; }
h1 { font-size: 2em; font-weight: bold; text-align: center; color: #fff; position: absolute; top: 50%; width: 100%; }
#context { display: none; }
#context li { position: absolute; left: 0; top: 0; -webkit-tranform: rotate(12deg); opacity: 1; transform-origin: 50% 50%; width: 10000px; text-indent: 80px; list-style:none; }
#context li span { z-index: 10; padding: 0 6px; border-radius: 3px; text-shadow: 0 0 6px White; }
#context li:hover span { cursor:pointer; background-color: #009; color: White; z-index: 100;text-shadow: 0 0 3px Black;} 

Right Click Menu - Script Codes JS Codes

function setMenu(e){ $('#context').show(); $('#context li').each(function(i){ var w = $(this).width(); var h = $(this).height(); if (e) { e.preventDefault(); $(this).offset({left: e.pageX, top: e.pageY-(h/2)}); } $(this).css('transform', 'rotate('+(15*(i))+'deg)'); //$(this).css('-webkit-transform-origin', ''+e.pageX+' '+e.pageY); // $(this).css('margin-left', ''+w+'px'); });
$(document).bind('contextmenu', setMenu);
$(document).bind('click', function(e){ $('#context').hide();
$(document).ready(function(e) { setMenu(); $('#context').hide(); });
Right Click Menu - Script Codes
Right Click Menu - Script Codes
Home Page Home
Developer Alexander Nastase
Username anodpixels
Uploaded August 21, 2022
Rating 3
Size 2,252 Kb
Views 44,528
Do you need developer help for Right Click Menu?

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!

Alexander Nastase (anodpixels) Script Codes
Create amazing art & images with AI!

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!