Team:EPF-Lausanne/Template/SubMenu

From 2012.igem.org

(Difference between revisions)
Line 2: Line 2:
<script type="text/javascript">
<script type="text/javascript">
var menu = "</html>{{{1}}}<html>";
var menu = "</html>{{{1}}}<html>";
 +
 +
var menus = {
 +
Home: [
 +
["Test", "#"],
 +
["Test2", "#"]
 +
],
 +
Team: [
 +
["Test3", "#"],
 +
["Test4", "#"]
 +
]
 +
};
</script>
</script>
<div class="sub-menu">
<div class="sub-menu">
-
<ul id='simple-navi'>
+
<ul class='simple-navi'>
-
<li class="left">
+
-
<span></span>
+
-
</li>
+
-
<li>
+
-
<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>
</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");
 +
 +
sub.append($("<li>").attr("class", "left"));
 +
 +
for(var i = 0; i < menus[menu]; i++){
 +
sub.append($("<li>")
 +
.append($("<a>")
 +
.attr("href", menus[menu][i][1])
 +
.append($("<span>").text(menus[menu][i][0]))));
 +
}
 +
 +
sub.append($("<li>").attr("class", "left"));
 +
}
 +
</script>
</html>
</html>

Revision as of 16:16, 12 September 2012