Team:EPF-Lausanne/Template/SubMenu

From 2012.igem.org

(Difference between revisions)
Line 2: Line 2:
<script type="text/javascript">
<script type="text/javascript">
window.menu = "</html>{{{1}}}<html>";
window.menu = "</html>{{{1}}}<html>";
-
 
-
var menus = {
 
-
Home: [
 
-
["Test", "#"],
 
-
["Test2", "#"]
 
-
],
 
-
Team: [
 
-
["Test3", "#"],
 
-
["Test4", "#"]
 
-
]
 
-
};
 
</script>
</script>
<div class="sub-menu">
<div class="sub-menu">
Line 20: Line 9:
<div style="clear: both"></div>
<div style="clear: both"></div>
</div>
</div>
-
 
-
<script type="text/javascript">
 
-
if(menus[window.menu]){
 
-
var sub = $(".sub-menu .simple-navi");
 
-
 
-
sub.append($("<li>").attr("class", "left").append($("<span>")));
 
-
 
-
for(var i = 0; i < menus[menu].length; i++){
 
-
sub.append($("<li>")
 
-
.append($("<a>")
 
-
.attr("href", menus[menu][i][1])
 
-
.append($("<span>").text(menus[menu][i][0]))));
 
-
}
 
-
 
-
sub.append($("<li>").attr("class", "right").append($("<span>")));
 
-
}
 
-
</script>
 
</html>
</html>

Revision as of 21:24, 12 September 2012