Template:Team:Groningen/Header
From 2010.igem.org
(Difference between revisions)
Joelkuiper (Talk | contribs) |
Joelkuiper (Talk | contribs) |
||
Line 29: | Line 29: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
- | |||
- | |||
var pages = ["home", "project", "human", "modeling", "team", "contact"]; | var pages = ["home", "project", "human", "modeling", "team", "contact"]; | ||
- | |||
- | |||
function ucfirst(str) { | function ucfirst(str) { | ||
- | + | var firstLetter = str.substr(0, 1); | |
- | + | return firstLetter.toUpperCase() + str.substr(1); | |
} | } | ||
$(document).ready(function() { | $(document).ready(function() { | ||
$("ul#topnav li").hover(function() { | $("ul#topnav li").hover(function() { | ||
- | + | $(this).css({ 'background' : '#1376c9 url(https://static.igem.org/mediawiki/2010/2/29/Groningen_topnav_active.gif) repeat-x'}); | |
- | + | $(this).find("span").show(); | |
} , function() { //on hover out... | } , function() { //on hover out... | ||
- | + | $(this).css({ 'background' : 'none'}); | |
- | + | $(this).find("span").hide(); | |
}); | }); | ||
- | + | ||
}); | }); | ||
- | + | $.address.change(function (event) { | |
- | + | var margin = $(".slide_content").width(); | |
- | + | var page = event.path.substring(1); | |
- | + | if(page == "") { page = 'home'; } | |
- | + | if ($.inArray(page, pages) !== -1) { | |
- | + | margin = (margin * ($.inArray(page, pages))) * -1; | |
- | + | $(".tabslider").stop().animate({ | |
- | + | marginLeft: margin + "px" | |
- | + | }, | |
- | + | {duration: 300, | |
- | + | complete: function() { $("#contentWrapper").css('height', $(".textWrapper[rel='"+page+"']").css('height')); } | |
- | + | }); } else { | |
- | + | $(".ajaxWrapper").html(""); | |
- | + | var url = wgServer + "/Team:Groningen/" + ucfirst(page) + "?action=render"; | |
- | + | $.get(url, function(data) { | |
- | + | $(".ajaxWrapper").html(data); | |
- | + | margin = (margin * (pages.length)) * -1; | |
- | + | $(".tabslider").css("margin-left", margin + "px"); | |
- | + | }); | |
- | + | } | |
- | + | }); | |
- | + | ||
- | + | ||
</script> | </script> | ||
<div id="overallMask"> | <div id="overallMask"> |
Revision as of 16:19, 25 October 2010
We believe in a better world
through synthetic biology