login  Naam:   Wachtwoord: 
Registreer je!
 Scripts:

Scripts > JS > Beveiliging > Rechter muisknop menu

Rechter muisknop menu

Auteur: eyecon - 09 september 2004 - 15:32 - Gekeurd door: Dennisvb - Hits: 9229 - Aantal punten: 3.17 (3 stemmen)



Met dit script kan je wanneer er op de rechtermuisknop geklikt is een menu'tje laten zien.

Code:
Zet dit in je body:

  1. <SCRIPT src="rightmenu.js" type=text/javascript></SCRIPT>


rightmenu.js
  1. //eyesys dhtml (c)eyecon 2002 [ eyecon@webteam.ro ]
  2. //visit www.webteam.ro for great scripts and tutorials
  3.  
  4. var ie5=window.createPopup
  5.  
  6. if (ie5)
  7. document.oncontextmenu=init;
  8. var eyesys="";
  9. var preitem="";
  10. function init(){
  11. mx=event.clientX;
  12. my=event.clientY;
  13. menx=window.screenLeft+mx;
  14. meny=window.screenTop+my;
  15. sysmen=window.createPopup();
  16. sysmen.document.write(eyesys);
  17. sysmen.show(menx,meny,eyesys_width,document.getElementById('men').offsetHeight);
  18. return false
  19. };
  20. function eyesys_init(){
  21. if (ie5){
  22. eyesys+=("<style type='text/css'>.textul{position:absolute;top:0px;color:"+eyesys_titletext+";writing-mode: tb-rl;padding-top:10px;filter: flipH() flipV() dropShadow( Color=000000,offX=-1,offY=-1,positive=true);z-Index:10;width:100%;height:100%;font: bold 12px sans-serif}.gradientul{position:relative;top:0px;left:0px;width:100%;background-color:"+eyesys_titlecol2+";height:100%;z-Index:9;FILTER: alpha( style=1,opacity=0,finishOpacity=100,startX=100,finishX=100,startY=0,finishY=100)}.contra{background-color:"+eyesys_titlecol1+";border:1px inset "+eyesys_bg+";height:98%;width:18px;z-Index:8;top:0px;left:0px;margin:2px;position:absolute;}.men{position:absolute;top:0px;left:0px;padding-left:18px;background-color:"+eyesys_bg+";border:2px outset "+eyesys_bg+";z-Index:1;}.men a{margin:1px;cursor:default;padding-bottom:4px;padding-left:1px;padding-right:1px;padding-top:3px;text-decoration:none;height:100%;width:100%;color:"+eyesys_cl+";font:bold 12px sans-serif;}.men a:hover{background:"+eyesys_bgov+";color:"+eyesys_clov+";} BODY{overflow:hidden;border:0px;padding:0px;margin:0px;}.ico{border:none;float:left;}</style><div class='men'>")
  23. }
  24. };
  25.  
  26. function eyesys_item(txt,ico,lnk){
  27. if (ie5){
  28. if(!ico)ico='s.gif';
  29. preitem+=("<a href='#' onmousedown='parent.window.location.href=\""+lnk+"\"'><img src='"+ico+"' width='16' height='16' class='ico'> "+txt+"</a>")
  30. }
  31. };
  32.  
  33. function eyesys_close(){
  34. if (ie5){
  35. eyesys+=preitem;
  36. eyesys+=("</div><div class='contra'><div class='gradientul'></div><div class='textul' id='titlu'>"+eyesys_title+"</div></div>");
  37. document.write("<div id='men' style='width:"+eyesys_width+"'></div>");
  38. document.getElementById('men').innerHTML=preitem
  39. }
  40. }
  41.  
  42.  
  43. //MENU TITLE
  44. eyesys_title="www.Sitemasters.be"
  45.  
  46. //TITLE BACKGROUND COLORS
  47. eyesys_titlecol1="972600"
  48. eyesys_titlecol2="ffcc66"
  49.  
  50. //TITLE COLOR
  51. eyesys_titletext="ffde98"
  52.  
  53. //MENU & ITEM BACKGROUND COLOR
  54. eyesys_bg="#ffde98"
  55.  
  56. //ITEM BACKGROUND COLOR ON MOUSE OVER
  57. eyesys_bgov="#ffcc66"
  58.  
  59. //MENU COLOR
  60. eyesys_cl="#004080"
  61.  
  62. //MENU COLOR ON MOUSE OVER
  63. eyesys_clov="004080"
  64.  
  65. //MENU WIDTH
  66. eyesys_width=180
  67.  
  68. //menu starts here
  69. eyesys_init()
  70.  
  71. //menu item sintax: eyesys_item(text,icon,link)
  72. //for no icon use 'null'
  73. eyesys_item('home','men_home.gif','main.php')
  74. eyesys_item('Afdrukken','men_print.gif','javascript:print()')
  75. eyesys_item('Vernieuwen','men_reload.gif','javascript:location.reload()')
  76. eyesys_item('Favorieten','men_fav.gif','main2.php')
  77. eyesys_item('Gastenboek','men_book.gif','www.gastenboek.nl')
  78. eyesys_item('Email','men_email.gif','mailform.php')
  79.  
  80. //mene closes here
  81. eyesys_close()
Download code! Download code (.txt)

 Bekijk een voorbeeld van dit script!
 Stemmen
Niet ingelogd.

 Reacties
Post een reactie
Lees de reacties (9)
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.032s