Advertisement
Guest User

Untitled

a guest
Oct 27th, 2011
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.24 KB | None | 0 0
  1. <HTML>
  2. <HEAD>
  3. <link rel="stylesheet" type="text/css" href="test.css" />
  4. <script type="text/javascript">
  5.  
  6. function show_alert()
  7. {
  8. alert("I am an alert box!");
  9. }
  10.  
  11. function doSomething(e, value) {
  12.     var rightclick;
  13.     if (!e) var e = window.event;
  14.     if (e.which) rightclick = (e.which == 3);
  15.     else if(e.button) rightclick = (e.button == 2); //{ //{
  16.    
  17.        
  18.         var posx = 0;
  19.         var posy = 0;
  20.         if (!e) var e = window.event;
  21.         if (e.pageX || e.pageY)     {
  22.             posx = e.pageX;
  23.             posy = e.pageY;
  24.         }
  25.         else if (e.clientX || e.clientY)    {
  26.             posx = e.clientX + document.body.scrollLeft
  27.                 + document.documentElement.scrollLeft;
  28.             posy = e.clientY + document.body.scrollTop
  29.                 + document.documentElement.scrollTop;
  30.         }
  31.         //document.getElementById("ContextMenu").style.position = "fixed";
  32.         document.getElementById("ContextMenu").style.left = posx + "px";
  33.         document.getElementById("ContextMenu").style.top = posy + "px";
  34.         document.getElementById("ContextMenu").style.visibility = "visible";
  35.        
  36.         //alert('Rightclick: ' + value);
  37.         //}
  38.        
  39.    
  40.     //alert('Rightclick: ' + value); // true or false
  41. }
  42.  
  43. function HideMenu(e) {
  44.  
  45.     var rightclick;
  46.     if (!e) var e = window.event;
  47.     if (e.which) rightclick = (e.which == 3);
  48.     else if(e.button) rightclick = (e.button == 2); //{ //{
  49.     document.getElementById("ContextMenu").style.visibility = "hidden";
  50.  
  51. }
  52. </script>
  53.  
  54. </HEAD>
  55. <BODY style="background-image:url('DrexelLogo.png'); background-repeat:no-repeat; background-position:right top; background-color:#21467B;position:relative;z-index:-1;" onmouseup="HideMenu(event)">
  56. <div style="z-index:0;">
  57. <div style="z-index:1">
  58. <BR><BR>
  59. <a href="#" class="myButton" onmouseup="doSomething(event, value)">my <BR>button</a>
  60. <input class="myButton" style="position:relative;z-index:2;" type="submit" value="my button" onmouseup="doSomething(event, value)">
  61. </div>
  62. </div>
  63.  
  64. <div class="myButton3" style="visibility:visible;position:relative;z-index:3;">
  65. Title: <input type="text" name="summary" size="80"/><BR>
  66. Location: <input type="text" name="location" size="80"/><BR>
  67. </div>
  68.  
  69.  
  70.  
  71.  
  72. <div class="myButton2" id = "ContextMenu" style="visibility:hidden;position:relative;z-index:3;">
  73. Some Text<BR>
  74. More Text<BR>
  75. And Even More Text
  76. </div>
  77.  
  78. </BODY>
  79. </HTML>
  80.  
  81.  
  82.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement