Template:Team:Groningen/sandboxHeader
From 2010.igem.org
(Difference between revisions)
Joelkuiper (Talk | contribs) |
Joelkuiper (Talk | contribs) |
||
Line 37: | Line 37: | ||
droplinemenu.buildmenu("droplinetabs1") | droplinemenu.buildmenu("droplinetabs1") | ||
}); | }); | ||
+ | $.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" | ||
+ | }, 300 | ||
+ | ); | ||
+ | |||
+ | } 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> |
Revision as of 10:43, 20 August 2010