Advertisement
Ilma

pop it menu

Oct 18th, 2012
18,259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /***********************************************
  2. * Pop-it menu- © Dynamic Drive (www.dynamicdrive.com)
  3. * This notice MUST stay intact for legal use
  4. * Visit http://www.dynamicdrive.com/ for full source code
  5. ***********************************************/
  6.  
  7. var defaultMenuWidth="150px" //set default menu width.
  8.  
  9. var linkset=new Array()
  10. //SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT
  11.  
  12. linkset[0]='<a>Index of Links</a>'
  13. linkset[0]+='<a href="http://w11.zetaboards.com/pathei_mathos/topic/8175693/">About God and Goddess // Guide to be Claimed</a>'
  14. linkset[0]+='<a href="http://w11.zetaboards.com/pathei_mathos/topic/8181299/1/#new">Camp Halfblood</a>'
  15. linkset[0]+='<a href="http://w11.zetaboards.com/pathei_mathos/single/?p=8101191&t=8181299">Classes and Trainings</a>'
  16. linkset[0]+='<a href="http://w11.zetaboards.com/pathei_mathos/topic/8183566/">Terminology and Creatures List</a>'
  17. linkset[0]+='<a href="http://w11.zetaboards.com/pathei_mathos/single/?p=8101190&t=8181299">List of Counselors</a>'
  18. linkset[0]+='<a href="http://w11.zetaboards.com/pathei_mathos/topic/8170290/">Wall of God and Goddess</a>'
  19. linkset[0]+='<a>Awards</a>'
  20. linkset[0]+='<a href="http://w11.zetaboards.com/pathei_mathos/topic/8172735/">Question?</a>'
  21. linkset[0]+='<a href="http://w11.zetaboards.com/pathei_mathos/topic/8172683/">Character Serve</a>'
  22. linkset[0]+='<a href="http://w11.zetaboards.com/pathei_mathos/topic/8205247/">Error Serve</a>'
  23. linkset[0]+='<a href="http://w11.zetaboards.com/pathei_mathos/topic/8173431/">Kritik dan Saran</a>'
  24. linkset[0]+='<a href="http://w11.zetaboards.com/pathei_mathos/topic/8172659/">Penggantian Nama Karakter</a>'
  25. linkset[0]+='<a href="http://w11.zetaboards.com/pathei_mathos/topic/8189507/">Demigods Abilities Data</a>'
  26. linkset[0]+='<a href="http://w11.zetaboards.com/pathei_mathos/topic/8172716/">Signature Request</a>'
  27. linkset[0]+='<a href="http://w11.zetaboards.com/pathei_mathos/topic/8172709/">Signature Gallery</a>'
  28. linkset[0]+='<a href="http://w11.zetaboards.com/pathei_mathos/topic/8212838/"><Apply for Affilates</a>'
  29.  
  30. ////No need to edit beyond here
  31.  
  32. var ie5=document.all && !window.opera
  33. var ns6=document.getElementById
  34.  
  35. if (ie5||ns6)
  36. document.write('<div id="popitmenu" onMouseover="clearhidemenu();" onMouseout="dynamichide(event)"></div>')
  37.  
  38. function iecompattest(){
  39. return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body
  40. }
  41.  
  42. function showmenu(e, which, optWidth){
  43. if (!document.all&&!document.getElementById)
  44. return
  45. clearhidemenu()
  46. menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu")
  47. menuobj.innerHTML=which
  48. menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth
  49. menuobj.contentwidth=menuobj.offsetWidth
  50. menuobj.contentheight=menuobj.offsetHeight
  51. eventX=ie5? event.clientX : e.clientX
  52. eventY=ie5? event.clientY : e.clientY
  53. //Find out how close the mouse is to the corner of the window
  54. var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX
  55. var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY
  56. //if the horizontal distance isn't enough to accomodate the width of the context menu
  57. if (rightedge<menuobj.contentwidth)
  58. //move the horizontal position of the menu to the left by it's width
  59. menuobj.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px"
  60. else
  61. //position the horizontal position of the menu where the mouse was clicked
  62. menuobj.style.left=ie5? iecompattest().scrollLeft+eventX+"px" : window.pageXOffset+eventX+"px"
  63. //same concept with the vertical position
  64. if (bottomedge<menuobj.contentheight)
  65. menuobj.style.top=ie5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px"
  66. else
  67. menuobj.style.top=ie5? iecompattest().scrollTop+event.clientY+"px" : window.pageYOffset+eventY+"px"
  68. menuobj.style.visibility="visible"
  69. return false
  70. }
  71.  
  72. function contains_ns6(a, b) {
  73. //Determines if 1 element in contained in another- by Brainjar.com
  74. while (b.parentNode)
  75. if ((b = b.parentNode) == a)
  76. return true;
  77. return false;
  78. }
  79.  
  80. function hidemenu(){
  81. if (window.menuobj)
  82. menuobj.style.visibility="hidden"
  83. }
  84.  
  85. function dynamichide(e){
  86. if (ie5&&!menuobj.contains(e.toElement))
  87. hidemenu()
  88. else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
  89. hidemenu()
  90. }
  91.  
  92. function delayhidemenu(){
  93. delayhide=setTimeout("hidemenu()",500)
  94. }
  95.  
  96. function clearhidemenu(){
  97. if (window.delayhide)
  98. clearTimeout(delayhide)
  99. }
  100.  
  101. if (ie5||ns6)
  102. document.onclick=hidemenu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement