Template:CSS/UT-Tokyo/Counter/Contents

From 2014.igem.org

(Difference between revisions)
Line 574: Line 574:
}
}
});
});
-
hoge = 1;
 
-
}else{
 
-
hoge = 1;
 
-
}
 
 +
}
var box = document.getElementsByClassName("pageContentsBox");
var box = document.getElementsByClassName("pageContentsBox");
var pc = document.getElementById("pageContents");
var pc = document.getElementById("pageContents");
Line 606: Line 603:
btnode.style.display = "block";
btnode.style.display = "block";
}
}
-
if(hoge == 1){
+
var hoge = 0;
-
clearInterval(huga);
+
-
if(typeof link !== "undefined"){
+
-
if(link == "top"){
+
-
$("#contentsBody").mCustomScrollbar("scrollTo","top");
+
-
}else{
+
-
var href = "#" + link;
+
-
var target = $(href);
+
-
$("#contentsBody").mCustomScrollbar("scrollTo",target);
+
-
}
+
-
}else{
+
-
if(typeof getUrlVars()["cont"] !== "undefined"){
+
-
var href = "#" + getUrlVars()["cont"];
+
-
var target = $(href);
+
-
$("#contentsBody").mCustomScrollbar("scrollTo",target);
+
-
}else{
+
-
$("#contentsBody").mCustomScrollbar("scrollTo","top");
+
-
}
+
-
}
+
-
}
+
var huga = setInterval(function(){
var huga = setInterval(function(){
-
if(hoge == 1){
 
-
clearInterval(huga);
 
if(typeof link !== "undefined"){
if(typeof link !== "undefined"){
if(link == "top"){
if(link == "top"){
$("#contentsBody").mCustomScrollbar("scrollTo","top");
$("#contentsBody").mCustomScrollbar("scrollTo","top");
-
}else{
+
clearInterval(huga);
 +
}else if(document.getElementById(link) != null){
var href = "#" + link;
var href = "#" + link;
var target = $(href);
var target = $(href);
$("#contentsBody").mCustomScrollbar("scrollTo",target);
$("#contentsBody").mCustomScrollbar("scrollTo",target);
 +
clearInterval(huga);
}
}
}else{
}else{
-
if(typeof getUrlVars()["cont"] !== "undefined"){
+
if(typeof getUrlVars()["contents"] !== "undefined"){
-
var href = "#" + getUrlVars()["cont"];
+
if(document.getElementById(getUrlVars()["contents"]) != null){
-
var target = $(href);
+
var href = "#" + getUrlVars()["contents"];
-
$("#contentsBody").mCustomScrollbar("scrollTo",target);
+
var target = $(href);
 +
$("#contentsBody").mCustomScrollbar("scrollTo",target);
 +
clearInterval(huga);
 +
}
}else{
}else{
$("#contentsBody").mCustomScrollbar("scrollTo","top");
$("#contentsBody").mCustomScrollbar("scrollTo","top");
 +
clearInterval(huga);
}
}
}
}
-
}
+
},500);
-
},1000);
+
var team = document.getElementById("Team-top");
var team = document.getElementById("Team-top");
if(team.style.display != "none"){
if(team.style.display != "none"){

Revision as of 14:28, 17 October 2014