Template:CSS/UT-Tokyo/Counter/Contents
From 2014.igem.org
(Difference between revisions)
Pineappler (Talk | contribs) |
Pineappler (Talk | contribs) |
||
Line 594: | Line 594: | ||
if(hoge == 1){ | if(hoge == 1){ | ||
clearInterval(huga); | clearInterval(huga); | ||
- | + | window.onload = function(){ | |
- | + | if(typeof link !== "undefined"){ | |
- | + | if(link == "top"){ | |
- | + | $("#contentsBody").mCustomScrollbar("scrollTo","top"); | |
+ | }else{ | ||
+ | var href = "#" + link; | ||
+ | var target = $(href); | ||
+ | $("#contentsBody").mCustomScrollbar("scrollTo",target); | ||
+ | } | ||
}else{ | }else{ | ||
- | + | if(typeof getUrlVars()["cont"] !== "undefined"){ | |
- | + | var href = "#" + getUrlVars()["cont"]; | |
- | + | var target = $(href); | |
- | + | $("#contentsBody").mCustomScrollbar("scrollTo",target); | |
- | + | }else{ | |
- | + | $("#contentsBody").mCustomScrollbar("scrollTo","top"); | |
- | + | } | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
} | } | ||
} | } | ||
- | |||
} | } | ||
},500); | },500); |