Guest User

Untitled

a guest
Aug 12th, 2012
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.02 KB | None | 0 0
  1. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  2. <html>
  3. <head>
  4. <!-- Customize Context Menu Code Start -->
  5. <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />   
  6.  
  7. <script src="jquery-1.4.2.min.js" type="text/javascript"></script>
  8. <script src="jquery.contextMenu.js" type="text/javascript"></script>
  9. <link href="jquery.contextMenu.css" rel="stylesheet" type="text/css" />
  10. <script type="text/javascript">
  11.     $(document).ready( function() {
  12.                
  13.         // Show menu when #myDiv is clicked
  14.         $("#myDiv a").contextMenu({menu: 'myMenu'},function(action, el, pos) {
  15.             alert(
  16.                 'Action: ' + action + '\n\n' +
  17.                 'Element ID: ' + $(el).attr('id') + '\n\n' +
  18.                 'X: ' + pos.x + '  Y: ' + pos.y + ' (relative to element)\n\n' +
  19.                 'X: ' + pos.docX + '  Y: ' + pos.docY+ ' (relative to document)'
  20.             );
  21.             });
  22.                
  23.         // Show menu when a list item is clicked
  24.         $("#myList UL LI").contextMenu({menu: 'myMenu'}, function(action, el, pos) {
  25.             alert(
  26.                 'Action: ' + action + '\n\n' +
  27.                 'Element text: ' + $(el).text() + '\n\n' +
  28.                 'X: ' + pos.x + '  Y: ' + pos.y + ' (relative to element)\n\n' +
  29.                 'X: ' + pos.docX + '  Y: ' + pos.docY+ ' (relative to document)'
  30.             );
  31.         });
  32.                
  33.     });
  34. </script>
  35.  
  36. <!-- Customize Context Menu Code End -->
  37. </head>
  38. <body>
  39.  
  40.     <h3>Asset List</h3>
  41.     <div id="myDiv">
  42.     <c:forEach items="${assets}" var="asset">
  43.         <a href="assets/<c:out value="${asset}"/>"><c:out value="${asset}"/></a>
  44.         <br />
  45.     </c:forEach>
  46.     </div>
  47.    
  48.     <br/><br/>
  49.     <a href="asset">Upload Asset</a>
  50. <!-- Customize Context Menu Code Start -->
  51.  
  52.        
  53.         <ul id="myMenu" class="contextMenu">
  54.             <li class="edit"><a href="#edit">Edit</a></li>
  55.             <li class="cut separator"><a href="#cut">Cut</a></li>
  56.             <li class="copy"><a href="#copy">Copy</a></li>
  57.             <li class="paste"><a href="#paste">Paste</a></li>
  58.             <li class="delete"><a href="#delete">Delete</a></li>
  59.             <li class="quit separator"><a href="#quit">Quit</a></li>
  60.         </ul>
  61. <!-- Customize Context Menu Code End -->
  62.  </body>
  63. </html>
Advertisement
Add Comment
Please, Sign In to add comment