Template:CSS/UT-Tokyo/Counter/Contents
From 2014.igem.org
(Difference between revisions)
Pineappler (Talk | contribs) |
Pineappler (Talk | contribs) |
||
Line 540: | Line 540: | ||
if(typeof link !== "undefined"){ | if(typeof link !== "undefined"){ | ||
- | var href = "#" + link; | + | 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"){ | if(typeof getUrlVars()["cont"] !== "undefined"){ | ||
var href = "#" + getUrlVars()["cont"]; | var href = "#" + getUrlVars()["cont"]; | ||
var target = $(href); | var target = $(href); | ||
- | + | $("#contentsBody").mCustomScrollbar("scrollTo",target); | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
}else{ | }else{ | ||
$("#contentsBody").mCustomScrollbar("scrollTo","top"); | $("#contentsBody").mCustomScrollbar("scrollTo","top"); |