A good right-click menu made by JS

Source: Internet
Author: User
It is easier to expand the Internet than I write ~ <HTML>  Code However, be sure not to enter \ "in it. You can only use '// if you want to achieve the jump, you can use the window. location = 'url'; var pH = 18, mwidth = 50; // The height of each option, total menu width var BGC = "# Eee ", txc = "black"; // No selected background color and text color. var cbgc = "darkblue", ctxc = "white "; // The background color and text color var mover = "this. style. background = '"+ cbgc +"'; this. style. color = '"+ ctxc +"'; "Var mout =" this. style. background = '"+ BGC +"'; this. style. color = '"+ txc +"'; "document. oncontextmenu = function () {mlay. style. display = ""; mlay. style. pixeltop = event. clienty; mlay. style. pixelleft = event. clientx; return false;} function showoff () {mlay. style. display = "NONE";} function fresh () {mlay. style. background = BGC; mlay. style. color = txc; mlay. style. width = mwidth; mlay. style. height = mname. length * pH; var H = "<Table width = 100% Height =" + mname. length * Ph + "PX cellpadding = 0 cellspacing = 0 border = 0>"; var I = 0; for (I = 0; I <mname. length; I ++) {H + = "<tr align = Center Height =" + Ph + "onclick = \" "+ murl [I] +" \ "onmouseover = \" "+ mover +" \ "onmouseout = \" "+ mout +" \ "> <TD style = 'font-size: 9pt; '> "+ mname [I] +" </TD> </tr> ";} H + =" </table> "; mlay. innerhtml = H ;}</SCRIPT> 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.