Advertisement
Guest User

Untitled

a guest
Apr 26th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <style>
  5. ul#menu {
  6. padding: 0;
  7. }
  8.  
  9. ul#menu li {
  10. display: inline;
  11. }
  12.  
  13. ul#menu li a {
  14. background-color: black;
  15. color: white;
  16. padding: 10px 20px;
  17. text-decoration: none;
  18. border-radius: 4px 4px 0 0;
  19. }
  20.  
  21. ul#menu li a:hover {
  22. background-color: orange;
  23. }
  24. </style>
  25.  
  26. <script>
  27. function callFunction(fruit){
  28. document.getElementById('myFrame').src="http://en.wikipedia.org/wiki/"+fruit;
  29. document.getElementById('divMyFrame').style.display='';
  30. }
  31. </script>
  32. </head>
  33.  
  34. <%@page import="java.util.*"%>
  35. <%
  36. int col = 2;
  37. String title = "List of fruits";
  38. /* Map<String, String> fruits = new HashMap<String, String>();
  39.  
  40. fruits.put("apple", "apple");
  41. fruits.put("strawberry", "strawberry");
  42. fruits.put("pear", "pear");
  43. fruits.put("banana", "banana");
  44. fruits.put("lemon", "lemon");
  45. fruits.put("mango", "mango");
  46. */
  47.  
  48. List<String> fruits = new ArrayList<String>();
  49. fruits.add("Apple");
  50. fruits.add("Strawberry");
  51. fruits.add("Pear");
  52. fruits.add("Banama");
  53. fruits.add("Lemon");
  54. fruits.add("Mango");
  55.  
  56. %>
  57. <body>
  58.  
  59. <h2><%=title %></h2>
  60.  
  61. <% Iterator<String> it = fruits.iterator();
  62. int count = 0;
  63. %>
  64.  
  65. <table>
  66. <%while(it.hasNext()){
  67. String fruit = it.next(); %>
  68. <tr>
  69. <td>
  70. <font color="green" size="3">
  71. <ul id="menu">
  72. <li>
  73. <a onclick='callFunction("<%=fruit%>")' id="<%=fruit%>"><%=fruit%></a>
  74. </li>
  75. </ul>
  76. </font>
  77. </td>
  78. </tr> <% } %>
  79.  
  80. </table>
  81.  
  82. <div id="divMyFrame" style="display: none; position: absolute; left: 150px; top: 30px; width: 620px; height: 500px; border: #003C79 1px solid; background-color: #FFFFFF; z-index: 1000;">
  83. <iframe id="myFrame" width="100%" height="100%" frameborder="0" scrolling="yes"></iframe>
  84. </div>
  85.  
  86. </body>
  87. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement