Team:TU Delft/header2

From 2010.igem.org

(Difference between revisions)
Line 76: Line 76:
{
{
var url = wgServer + "/Team:TU_Delft/" + page + "?action=render";
var url = wgServer + "/Team:TU_Delft/" + page + "?action=render";
-
$("#load").fadeOut(200);
 
$.get(url, function(data) {
$.get(url, function(data) {
$("#load").html(data).fadeIn(200);
$("#load").html(data).fadeIn(200);
Line 86: Line 85:
// hash doesn't contain the first # character.
// hash doesn't contain the first # character.
if(hash) {
if(hash) {
-
if(hash.split('=').length == 1)  
+
if(hash.split('=').length == 1) {
 +
alert('load hash as page' + hash);
loadPage(hash);
loadPage(hash);
-
else {
+
} else {
    var kvmap = splitHash(hash);
    var kvmap = splitHash(hash);
-
if (kvmap.page)
+
if (kvmap.page) {
 +
alert('load hashmap.page' + kvmap.page);
loadPage(kvmap.page);
loadPage(kvmap.page);
-
else if(kvmap.anchor)  
+
} else if(kvmap.anchor) {
 +
alert('scrolling to anchor: ' + kvmap.anchor);
window.scrollTo(0, $(kvmap.anchor).position().top);
window.scrollTo(0, $(kvmap.anchor).position().top);
-
}  
+
}
 +
}
} else {
} else {
// start page
// start page
Line 107: Line 110:
if(this.hash)
if(this.hash)
-
this.href = '#fakeanchor';// '#anchor=' + this.href.substring(1);
+
this.href = '#anchor=' + this.href.substring(1);
else if(txt != "edit")
else if(txt != "edit")
this.href = this.href.replace("https://2010.igem.org/Team:TU_Delft/", "#page=");
this.href = this.href.replace("https://2010.igem.org/Team:TU_Delft/", "#page=");

Revision as of 12:58, 22 July 2010