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"> </a></li> | <li class="press"><a href="https://2010.igem.org/Team:TU_Delft/press" title="Press"> </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). | + | var url = $("*", this).attr("href"); |
+ | var title = $("*", this).attr("title"); | ||
- | |||
- | |||
// create normal div with click action | // create normal div with click action | ||
- | // | + | 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