Team:TU Delft/menu test

From 2010.igem.org

(Difference between revisions)
Line 10: Line 10:
<li class="press"><a href="https://2010.igem.org/Team:TU_Delft/press" title="Press">&nbsp;</a></li>
<li class="press"><a href="https://2010.igem.org/Team:TU_Delft/press" title="Press">&nbsp;</a></li>
</ul>
</ul>
 +
<style>
 +
.button_pointer { cursor:pointer; }
 +
</style>
 +
 
<script type="text/javascript">
<script type="text/javascript">
$("#navlist > *").each (function() {
$("#navlist > *").each (function() {
   // load URL from link element
   // load URL from link element
-
   var url = $(this).get(0).text();// attr("href");
+
   var url = $("*", this).attr("href");
 +
  var title = $("*", this).attr("title");
-
  alert(url);
 
-
 
   // create normal div with click action
   // create normal div with click action
-
// $(this).text(url);
+
  var button = $(this).html("<div>"+title+"</div>");
 +
 
 +
  button.click(function() {
 +
    window.location = url;
 +
  });
 +
 
 +
  // setup hovering
 +
  button.hover(function() {
 +
    $(this).addClass("button_hover");
 +
  }, function() {
 +
    $(this).removeClass("button_hover");
 +
  });
 +
 
 +
  $(this).addClass("button_pointer");
});
});
</script>
</script>
</html>
</html>

Revision as of 14:10, 4 June 2010