SMF For Free Support Forum

SMF For Free Support => SMF For Free Codes and Support => Topic started by: Qub1 on February 25, 2008, 08:36:21 am

Title: [CODE] Cool Right-Click Links Menu (To a Topic, Post or Page) [Qub1]
Post by: Qub1 on February 25, 2008, 08:36:21 am
Forum Url: http://narutolounge.smfforfree4.com

IE Only!

Previeuw (http://www.qub1test.smfforfree4.com)

This Code is for a Cool new Right-Click menu. So, when you Right-Click, you will get a little menu instead of the Normal Right-Click menu, and there you can Put Links, text and if it Works also Images. BUT remember, when you put a Link in the Menu, just put the Topic, Post or Page text in it, like if you want to make a link to: www.narutolounge.smfforfree4.com/index.php/topic,1.0.html, you just insert: ''index.php/topic,1.0.html'' as link. Here's how to Install:

Put this in your Headers (Edit the Coloured Text, instructions are below):
Red = Menu Background Colour
Yellow = Menu Text Style
Quote
<STYLE>
#contextMenu {
  position: absolute;
  visibility: hidden;
  width: 120px;
  background-color: lightgrey;
  layer-background-color: lightgrey;
  border: 2px outset white;
}

.A:Menu {
   color: black;
   text-decoration: none;
  cursor: default;
   width: 100%
  }

 .A:MenuOn {
   color: white;
   text-decoration: none;
   background-color: darkblue;
  cursor: default;
   width: 100%
  }
</STYLE>

<SCRIPT>
var menu;
function showMenu (evt) {
  if (document.all) {
    document.all.contextMenu.style.pixelLeft = event.clientX;
    document.all.contextMenu.style.pixelTop = event.clientY;
    document.all.contextMenu.style.visibility = 'visible';
    return false;
  }
  else if (document.layers) {
    if (evt.which == 3) {
      document.contextMenu.left = evt.x;
      document.contextMenu.top = evt.y;
      document.contextMenu.onmouseout =
        function (evt) { this.visibility = 'hide'; };
      document.contextMenu.visibility = 'show';
      return false;
    }
  }
  return true;
}
if (document.all)
  document.oncontextmenu =showMenu;
if (document.layers) {
  document.captureEvents(Event.MOUSEDOWN);
  document.onmousedown = showMenu;
}
</SCRIPT>


And now Paste this in your Footers (Edit the Coloured Text, instructions are below):
Blue = The Link location, if you don't want it to be a Link, just delete all the Link Text
Yellow = The Text that will be Displayed as the Link before
Quote
<DIV ID="contextMenu"
     ONMOUSEOUT="menu = this; this.tid = setTimeout ('menu.style.visibility = \'hidden\'', 20);"      ONMOUSEOVER="clearTimeout(this.tid);" >
<a HREF="index.php/topic,1.0.html" CLASS="menu" ONMOUSEOVER="this.className = 'menuOn'" ONMOUSEOUT="this.className = 'menu';" ; target="_blank"> This Menu was</a>
<BR>
<a HREF="index.php/topic,1.0.html" CLASS="menu" ONMOUSEOVER="this.className = 'menuOn'" ONMOUSEOUT="this.className = 'menu';" ; target="_blank"> Created by Qub1</a>
</DIV>

To add more Lines of Text, just add more of this code before this Text </DIV>: (Edit the Coloured Text, instructions are below):
Blue = The Link location, if you don't want it to be a Link, just delete all the Link Text
Yellow = The Text that will be Displayed as the Link before
Quote
<BR>
<a HREF="index.php/topic,1.0.html" CLASS="menu" ONMOUSEOVER="this.className = 'menuOn'" ONMOUSEOUT="this.className = 'menu';" ; target="_blank"> This Menu was Created by Qub1</a>


Thanks ya all, if you like this Code, please say so.
- Qub1 (http://www.narutolounge.smfforfree4.com)
Title: Re: [CODE] Cool Right-Click Links Menu (To a Topic, Post or Page) [Qub1]
Post by: Celebrus on February 25, 2008, 08:26:03 pm
The preview ain't working on FF. It's only working on my IE.
Title: Re: [CODE] Cool Right-Click Links Menu (To a Topic, Post or Page) [Qub1]
Post by: simply sibyl on February 25, 2008, 08:54:25 pm
same here..  works with IE 7.0....   not workin with Firefox/Seamonkey/Opera
Title: Re: [CODE] Cool Right-Click Links Menu (To a Topic, Post or Page) [Qub1]
Post by: Qub1 on February 26, 2008, 05:02:24 am
Ok, i will add that to the Post.