Template:Kyoto/js

From 2012.igem.org

(Difference between revisions)
 
(36 intermediate revisions not shown)
Line 2: Line 2:
<html>
<html>
<script type="text/javascript">
<script type="text/javascript">
-
$(function() {
 
-
    setScroll($("#kyoto-menu"));
 
-
    setScroll($(".kyoto-post-it"));
 
-
});
 
-
 
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(self) {
+
 
-
var tabs = $("#kyoto-tabs").children();
+
function changeTab(tab) {
-
alert(tabs[0]);
+
var $tabs = $("#kyoto-tabs").children("li");
-
/*
+
$tabs.css("border-bottom","1px solid #c8c2b6");
-
var contents = document.getElementById("kyoto-tab-contents").childNodes;
+
tab.css("border-bottom","none");
-
var i;
+
-
for (i = 0; i < tabs.length; i++) {
+
-
if (tabs[i].nodeType == 1) tabs[i].style.zIndex = 99;
+
-
}
+
-
self.style.zIndex = 101;
+
-
*/
+
}
}
 +
 +
$(function() {
 +
setScroll($("#kyoto-menu"));
 +
setScroll($(".kyoto-post-it"));
 +
        setScroll($("#goldenpost"));
 +
$("#kyoto-tabs").children("li").click(function() { changeTab($(this)); });
 +
});
</script>
</script>
</html>
</html>

Latest revision as of 01:17, 27 October 2012