Template:CSS/UT-Tokyo/Counter/Contents

From 2014.igem.org

(Difference between revisions)
Line 540: Line 540:
if(typeof link !== "undefined"){
if(typeof link !== "undefined"){
-
var href = "#" + link;
+
if(link == "top"){
-
var target = $(href);
+
$("#contentsBody").mCustomScrollbar("scrollTo","top");
-
$("#contentsBody").mCustomScrollbar("scrollTo",target);
+
}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);
-
alert(getUrlVars()["cont"]);
+
$("#contentsBody").mCustomScrollbar("scrollTo",target);
-
var tmpStr = getUrlVars()["cont"];
+
-
var node = document.getElementById(str);
+
-
alert(tmpStr);
+
-
if(document.getElementById(tmpStr).style.display != "none"){
+
-
alert("test");
+
-
}else if(document.getElementById(tmpStr).style.display == "none"){
+
-
alert("test2");
+
-
}else{
+
-
alert("test3");
+
-
}
+
-
if(document.getElementById(str).getElementById(tmpStr) != null){
+
-
$("#contentsBody").mCustomScrollbar("scrollTo",target);
+
-
}else{
+
-
alert("test2");
+
-
$("#contentsBody").mCustomScrollbar("scrollTo","top");
+
-
}
+
}else{
}else{
$("#contentsBody").mCustomScrollbar("scrollTo","top");
$("#contentsBody").mCustomScrollbar("scrollTo","top");

Revision as of 07:41, 12 October 2014