Template:Kyoto/js

From 2012.igem.org

(Difference between revisions)
 
(18 intermediate revisions not shown)
Line 3: Line 3:
<script type="text/javascript">
<script type="text/javascript">
function showTab(tabname) {
function showTab(tabname) {
-
     var children = document.getElementById("kyoto-tab-contents").childNodes;
+
     var $children = $("#kyoto-tab-contents").children("div");
-
    for (var i = 0; i < children.length; i++) {
+
$children.css("display","none");
-
        if (children[i].nodeType == 1) {
+
-
            children[i].style.display = "none";
+
-
        }
+
-
    }
+
     document.getElementById(tabname).style.display = "block";
     document.getElementById(tabname).style.display = "block";
 +
}
 +
 +
function changeTab(tab) {
 +
var $tabs = $("#kyoto-tabs").children("li");
 +
$tabs.css("border-bottom","1px solid #c8c2b6");
 +
tab.css("border-bottom","none");
}
}
Line 15: Line 17:
setScroll($("#kyoto-menu"));
setScroll($("#kyoto-menu"));
setScroll($(".kyoto-post-it"));
setScroll($(".kyoto-post-it"));
-
$("#kyoto-tabs").children("li").click(function() {
+
        setScroll($("#goldenpost"));
-
var tabs = $("#kyoto-tabs").children("li");
+
$("#kyoto-tabs").children("li").click(function() { changeTab($(this)); });
-
/*for (var i = 0; i < tabs.length; i++) tabs[i].css("border-bottom","none");*/
+
-
$(this).css("border","1px solid #c8c2b6");
+
-
});
+
});
});
</script>
</script>
</html>
</html>

Latest revision as of 01:17, 27 October 2012