Team:TU Delft/header2
From 2010.igem.org
(Difference between revisions)
Line 59: | Line 59: | ||
); | ); | ||
}); | }); | ||
+ | |||
+ | |||
function splitHash(hash) { | function splitHash(hash) { | ||
Line 88: | Line 90: | ||
else { | else { | ||
var kvmap = splitHash(hash); | var kvmap = splitHash(hash); | ||
- | if (kvmap.page) loadPage(kvmap.page); | + | if (kvmap.page) |
+ | loadPage(kvmap.page); | ||
+ | else if(kvmap.anchor) | ||
+ | window.scrollTo(0, $(kvmap.anchor).position().top); | ||
} | } | ||
} else { | } else { | ||
Line 100: | Line 105: | ||
$("a",elem).each(function() { | $("a",elem).each(function() { | ||
var txt = $(this).text(); | var txt = $(this).text(); | ||
- | if(txt != "edit") | + | if(this.href.charAt(0) == '#') |
- | this.href = this.href.replace("Team:TU_Delft/", | + | this.href = '#anchor=' + txt.substring(1); |
+ | else if(txt != "edit") | ||
+ | this.href = this.href.replace("https://2010.igem.org/Team:TU_Delft/", "#page="); | ||
}); | }); | ||
} | } |
Revision as of 12:08, 22 July 2010