Template:CSS/UT-Tokyo/Counter/Contents
From 2014.igem.org
(Difference between revisions)
Pineappler (Talk | contribs) |
Pineappler (Talk | contribs) |
||
Line 547: | Line 547: | ||
var href = "#" + getUrlVars()["cont"]; | var href = "#" + getUrlVars()["cont"]; | ||
var target = $(href); | var target = $(href); | ||
- | $("#contentsBody").mCustomScrollbar("scrollTo",target); | + | if(target.style.display != "none"){ |
+ | $("#contentsBody").mCustomScrollbar("scrollTo",target); | ||
+ | }else{ | ||
+ | $("#contentsBody").mCustomScrollbar("scrollTo","top"); | ||
+ | } | ||
}else{ | }else{ | ||
$("#contentsBody").mCustomScrollbar("scrollTo","top"); | $("#contentsBody").mCustomScrollbar("scrollTo","top"); |