Team:TU Delft/menu

From 2010.igem.org

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

Revision as of 14:47, 4 June 2010