Template:CSS/UT-Tokyo/Counter/Contents
From 2014.igem.org
(Difference between revisions)
Pineappler (Talk | contribs) |
Pineappler (Talk | contribs) |
||
Line 547: | Line 547: | ||
var node = document.getElementById(str); | var node = document.getElementById(str); | ||
+ | |||
+ | var hoge = 0; | ||
var read = "#" + str; | var read = "#" + str; | ||
Line 555: | Line 557: | ||
if(data == null){ | if(data == null){ | ||
$(read).append("読み込みに失敗しました"); | $(read).append("読み込みに失敗しました"); | ||
+ | hoge = 1; | ||
+ | }else{ | ||
+ | hoge = 1; | ||
} | } | ||
}); | }); | ||
Line 586: | Line 591: | ||
btnode.style.display = "block"; | btnode.style.display = "block"; | ||
} | } | ||
- | if(typeof link !== "undefined"){ | + | var huga = setInterval(function(){ |
- | + | if(hoge == 1){ | |
- | + | if(typeof link !== "undefined"){ | |
- | + | if(link == "top"){ | |
- | + | $("#contentsBody").mCustomScrollbar("scrollTo","top"); | |
- | + | }else{ | |
- | $("#contentsBody").mCustomScrollbar("scrollTo",target); | + | 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"); | ||
+ | } | ||
+ | } | ||
+ | clearInterval(hoge); | ||
} | } | ||
- | } | + | },500); |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
var team = document.getElementById("Team-top"); | var team = document.getElementById("Team-top"); | ||
if(team.style.display != "none"){ | if(team.style.display != "none"){ |