Team:TU Delft/menu test
From 2010.igem.org
(Difference between revisions)
Line 68: | Line 68: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
+ | |||
+ | function registerButton(btnName) { | ||
+ | var btn= $(".menu_button_" + btnName); | ||
+ | |||
+ | btn.click(function() { alert(btnName); }); | ||
+ | } | ||
// this runs when page is loaded | // this runs when page is loaded | ||
$(function() { | $(function() { | ||
+ | var buttonList = [ "home", "blog", "competition", "background", "project", "education", "sponsors", "press" ]; | ||
+ | for(var btn in buttonList) | ||
+ | registerButton(btn); | ||
+ | }); | ||
+ | /* | ||
$("#navlist > *").each (function() { | $("#navlist > *").each (function() { | ||
// load URL from link element | // load URL from link element | ||
Line 78: | Line 89: | ||
button.click(function() { | button.click(function() { | ||
- | $("#main_td").load(url); | + | $("#main_td").load(url + "?action=render"); |
//alert(url); | //alert(url); | ||
// window.location = url; | // window.location = url; | ||
Line 93: | Line 104: | ||
}); | }); | ||
- | }); | + | });*/ |
</script> | </script> | ||
</html> | </html> |
Revision as of 22:01, 4 June 2010