»
EnglishFrenchVietnamese

Print - Right Click Context Menu - JavaScriptBank.com

Full version: jsB@nk » Menu » Right click menu » Right Click Context Menu
URL: https://www.javascriptbank.com/right-click-context-menu.html

Right Click Context Menu © JavaScriptBank.comA different script to display a custom JavaScript menu in place of the default context JavaScript menu when you right click the mouse, with this JavaScript.

Full version: jsB@nk » Menu » Right click menu » Right Click Context Menu
URL: https://www.javascriptbank.com/right-click-context-menu.html



CSS
<STYLE>#ie5menu { BACKGROUND-COLOR: menu; BORDER-BOTTOM: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; CURSOR: default; FONT-FAMILY: Verdana; LINE-HEIGHT: 20px; POSITION: absolute; VISIBILITY: hidden; WIDTH: 250px }.menuitems { PADDING-LEFT: 15px; PADDING-RIGHT: 15px }</STYLE><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


JavaScript
<SCRIPT language=JavaScript1.2>// set this variable to 1 if you wish the URLs of the highlighted// menu to be displayed in the status barvar display_url=1function showmenuie5(){ie5menu.style.left=document.body.scrollLeft+event.clientXie5menu.style.top=document.body.scrollTop+event.clientYie5menu.style.visibility="visible"return false}function hidemenuie5(){ie5menu.style.visibility="hidden"}function highlightie5(){if (event.srcElement.className=="menuitems"){event.srcElement.style.backgroundColor="highlight"event.srcElement.style.color="white"if (display_url==1)window.status=event.srcElement.url}}function lowlightie5(){if (event.srcElement.className=="menuitems"){event.srcElement.style.backgroundColor=""event.srcElement.style.color="black"   // The menu's text color// Use the same color lower at the <FONT color="color"> tag (VERY IMPORTANT)window.status=''}}function jumptoie5(){if (event.srcElement.className=="menuitems")window.location=event.srcElement.url}</SCRIPT><SCRIPT language=JavaScript1.2>document.oncontextmenu=showmenuie5if (document.all&&window.print)document.body.onclick=hidemenuie5</SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<DIV id=ie5menu onclick=jumptoie5() onmouseout=lowlightie5() onmouseover=highlightie5()><!-- The color used for the text on the menu --><FONT color=black><!-- This is the font face that the menu will use --><FONT face=arial size=2><!-------------------------------- LINKS GO IN HERE -------------------------------------------><!--  To add a link use the following line:<DIV class=menuitems url="the link you want">the text to display</DIV>or<DIV class=menuitems url="the link you want" target="the target">the text to display</DIV>to use another target frame than the page default.  To insert a line brake use the following line:<HR>That all you need to ad your menus--><DIV class=menuitems url="http://javascriptbank.com/" target="_blank">JavaScriptBank.com</DIV><HR><DIV class=menuitems url="">Link 1</DIV><DIV class=menuitems url="">Link 2</DIV><DIV class=menuitems url="">Link 3</DIV><DIV class=menuitems url="">Link 4</DIV><DIV class=menuitems url="">Link 5</DIV><DIV class=menuitems url="">Link 6</DIV><HR><DIV class=menuitems url="mailto:someone@somewhere.com">Email Me</DIV><!--------------------------- LINKS END HERE -------------------------------------------------></DIV></FONT><!-- Place here your page default color --><FONT color=white><SCRIPT language=JavaScript1.2>document.oncontextmenu=showmenuie5if (document.all&&window.print)document.body.onclick=hidemenuie5</SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->