Team:EPF-Lausanne/Template/SubMenu

From 2012.igem.org

(Difference between revisions)
 
(5 intermediate revisions not shown)
Line 1: Line 1:
<html>
<html>
 +
<script type="text/javascript">
 +
var menu = "</html>{{{1}}}<html>";
 +
 +
var menus = {
 +
Home: [
 +
["Test", "#"],
 +
["Test2", "#"]
 +
],
 +
Team: [
 +
["Test3", "#"],
 +
["Test4", "#"]
 +
]
 +
};
 +
</script>
<div class="sub-menu">
<div class="sub-menu">
-
<ul id='simple-navi'>
+
<div class='simple-navi'>
-
<li class="left">
+
<ul>
-
<span></span>
+
-
</li>
+
</ul>
-
<li>
+
</div>
-
<a href='/Team:EPF-Lausanne'>
+
-
<span>Home</span>
+
-
</a>
+
-
</li>
+
-
<li>
+
-
<a href='/Team:EPF-Lausanne/Team'>
+
-
<span>Team</span>
+
-
</a>
+
-
</li>
+
-
<li>
+
-
<a href='/Team:EPF-Lausanne/Project'>
+
-
<span>Project</span>
+
-
</a>
+
-
</li>
+
-
<li>
+
-
<a href='/Team:EPF-Lausanne/Notebook'>
+
-
<span>Notebook</span>
+
-
</a>
+
-
</li>
+
-
<li>
+
-
<a href='/Team:EPF-Lausanne/Sponsors'>
+
-
<span>Sponsors</span>
+
-
</a>
+
-
</li>
+
-
<li class="right">
+
-
<span></span>
+
-
</li>
+
-
</ul>
+
<div style="clear: both"></div>
<div style="clear: both"></div>
</div>
</div>
 +
 +
<script type="text/javascript">
 +
if(menus[menu]){
 +
var sub = $(".sub-menu .simple-navi ul");
 +
 +
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>

Latest revision as of 16:32, 13 September 2012