User:Jannetta/Test
From 2010.igem.org
(Difference between revisions)
Line 1: | Line 1: | ||
<html> | <html> | ||
<head> | <head> | ||
+ | <script type="text/javascript"> | ||
+ | |||
+ | function ucfirst(str) { | ||
+ | var firstLetter = str.substr(0, 1); | ||
+ | return firstLetter.toUpperCase() + str.substr(1); | ||
+ | } | ||
+ | var pages = ["home", "project", "ethics", "modeling", "team", "contact"]; | ||
+ | |||
+ | $(function () { | ||
+ | |||
+ | $(".current").removeClass("current"); | ||
+ | $('.lavaLampBottomStyle [rel=' + $.address.value().substr(1) + ']').parent().addClass("current"); | ||
+ | |||
+ | $("#tabs").lavaLamp({ | ||
+ | fx: "backout", | ||
+ | speed: 700, | ||
+ | click: function (event, obj) { | ||
+ | $.address.value($(obj).find('a').attr('rel')); | ||
+ | if ($("#home").length !== 0) { | ||
+ | return false; | ||
+ | } else { | ||
+ | return true; | ||
+ | } | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | $.address.change(function (event) { | ||
+ | var margin = $(".slide_content").width(); | ||
+ | |||
+ | var page = event.path.substring(1); | ||
+ | if(page == "") { page = 'home'; } | ||
+ | |||
+ | v = $('.lavaLampBottomStyle [rel=' + page + ']').parent(); | ||
+ | |||
+ | if ($.inArray(page, pages) !== -1) { | ||
+ | $(".back").show(); | ||
+ | $(".lavaLampBottomStyle").trigger("move", v); | ||
+ | margin = (margin * ($.inArray(page, pages))) * -1; | ||
+ | $(".tabslider").stop().animate({ | ||
+ | marginLeft: margin + "px" | ||
+ | }, 300 | ||
+ | ); | ||
+ | |||
+ | } else { | ||
+ | $(".ajaxWrapper").html(""); | ||
+ | $(".back").hide(); | ||
+ | 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> | ||
+ | |||
<style type="text/css"> | <style type="text/css"> | ||
body {behavior: url(http://www.xs4all.nl/~peterned/htc/csshover3-source.htc);} | body {behavior: url(http://www.xs4all.nl/~peterned/htc/csshover3-source.htc);} |
Revision as of 00:07, 27 July 2010